Files
denlvovich c889d83d04 Prevents cyclic creation of input blocks
commit_hash:31429e3e5b76469c00283a386e078e61a45eafaf
2025-04-02 13:42:30 +03:00

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