Fix screen template unit tests to use Swift Testing conventions (#5187)

This commit is contained in:
Copilot
2026-03-11 15:20:21 +00:00
committed by GitHub
parent c3ba6113fe
commit 21a1c8d4a3

View File

@@ -20,18 +20,21 @@ struct TemplateScreenViewModelTests {
viewModel = TemplateScreenViewModel()
}
func testInitialState() {
@Test
func initialState() {
#expect(!context.composerText.isEmpty)
#expect(context.viewState.counter == 0)
}
func testTextField() {
@Test
func textField() {
context.composerText = "123"
context.send(viewAction: .textChanged)
#expect(context.composerText == "123")
}
func testCounter() async throws {
@Test
func counter() async throws {
var deferred = deferFulfillment(context.observe(\.viewState.counter)) { $0 == 1 }
context.send(viewAction: .incrementCounter)
try await deferred.fulfill()