mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +00:00
Fix screen template unit tests to use Swift Testing conventions (#5187)
This commit is contained in:
+6
-3
@@ -20,18 +20,21 @@ struct TemplateScreenViewModelTests {
|
|||||||
viewModel = TemplateScreenViewModel()
|
viewModel = TemplateScreenViewModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
func testInitialState() {
|
@Test
|
||||||
|
func initialState() {
|
||||||
#expect(!context.composerText.isEmpty)
|
#expect(!context.composerText.isEmpty)
|
||||||
#expect(context.viewState.counter == 0)
|
#expect(context.viewState.counter == 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testTextField() {
|
@Test
|
||||||
|
func textField() {
|
||||||
context.composerText = "123"
|
context.composerText = "123"
|
||||||
context.send(viewAction: .textChanged)
|
context.send(viewAction: .textChanged)
|
||||||
#expect(context.composerText == "123")
|
#expect(context.composerText == "123")
|
||||||
}
|
}
|
||||||
|
|
||||||
func testCounter() async throws {
|
@Test
|
||||||
|
func counter() async throws {
|
||||||
var deferred = deferFulfillment(context.observe(\.viewState.counter)) { $0 == 1 }
|
var deferred = deferFulfillment(context.observe(\.viewState.counter)) { $0 == 1 }
|
||||||
context.send(viewAction: .incrementCounter)
|
context.send(viewAction: .incrementCounter)
|
||||||
try await deferred.fulfill()
|
try await deferred.fulfill()
|
||||||
|
|||||||
Reference in New Issue
Block a user