Add properties and docs to TestView
This commit is contained in:
parent
2e1bf91655
commit
e0861934e6
|
@ -7,6 +7,22 @@
|
|||
|
||||
import Gluon
|
||||
|
||||
public class TestView {
|
||||
|
||||
/// A class that `TestRenderer` uses as a target.
|
||||
/// When rendering to a `TestView` instance it is possible
|
||||
/// to examine its `subviews` and `props` for testing.
|
||||
public final class TestView {
|
||||
/// Subviews of this test view.
|
||||
public private(set) var subviews = [TestView]()
|
||||
|
||||
/// Props assigned to this test view.
|
||||
public internal(set) var props: AnyEquatable
|
||||
|
||||
/// Initialize a new test view.
|
||||
init(props: AnyEquatable) {
|
||||
self.props = props
|
||||
}
|
||||
|
||||
func add(subview: TestView) {
|
||||
subviews.append(subview)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue