mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
c889d83d04
commit_hash:31429e3e5b76469c00283a386e078e61a45eafaf
30 lines
818 B
Swift
30 lines
818 B
Swift
import LayoutKit
|
|
import VGSL
|
|
import XCTest
|
|
|
|
final class TextInputBlockTests: XCTestCase {
|
|
func test_updateReturnsSameBlockForSameFocus() {
|
|
let block = TextInputBlock(
|
|
hint: NSAttributedString(),
|
|
textValue: Binding(name: "name", value: Property(initialValue: "Test")),
|
|
textTypo: Typo(),
|
|
path: "",
|
|
layoutDirection: .leftToRight
|
|
)
|
|
|
|
XCTAssertTrue(try block.updated(path: "", isFocused: false) === block)
|
|
}
|
|
|
|
func test_updateReturnsDifferentBlockForDifferentFocus() {
|
|
let block = TextInputBlock(
|
|
hint: NSAttributedString(),
|
|
textValue: Binding(name: "name", value: Property(initialValue: "Test")),
|
|
textTypo: Typo(),
|
|
path: "",
|
|
layoutDirection: .leftToRight
|
|
)
|
|
|
|
XCTAssertTrue(try block.updated(path: "", isFocused: true) !== block)
|
|
}
|
|
}
|