Add properties and docs to TestView

This commit is contained in:
Max Desiatov 2018-12-25 14:53:53 +01:00
parent 2e1bf91655
commit e0861934e6
1 changed files with 18 additions and 2 deletions

View File

@ -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)
}
}