Skip to content

Commit c26ca84

Browse files
committed
fix unit tests
1 parent 713087b commit c26ca84

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

Development.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Pod::Spec.new do |s|
7373
test_spec.dependency 'BackStackContainer'
7474
test_spec.dependency 'ModalContainer'
7575
test_spec.dependency 'AlertContainer'
76+
test_spec.dependency 'WorkflowSwiftUI'
7677
test_spec.requires_app_host = true
7778
test_spec.app_host_name = 'Development/SampleTicTacToe'
7879
test_spec.source_files = 'Samples/TicTacToe/Tests/**/*.swift'

Samples/TicTacToe/Tests/AuthenticationWorkflowTests.swift

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,10 @@ class AuthenticationWorkflowTests: XCTestCase {
183183
.expectWorkflow(
184184
type: LoginWorkflow.self,
185185
producingRendering: LoginScreen(
186+
actionSink: .noop(),
186187
title: "",
187188
email: "",
188-
onEmailChanged: { _ in },
189-
password: "",
190-
onPasswordChanged: { _ in },
191-
onLoginTapped: {}
189+
password: ""
192190
)
193191
)
194192
.render { screen in
@@ -210,12 +208,10 @@ class AuthenticationWorkflowTests: XCTestCase {
210208
.expectWorkflow(
211209
type: LoginWorkflow.self,
212210
producingRendering: LoginScreen(
211+
actionSink: .noop(),
213212
title: "",
214213
email: "",
215-
onEmailChanged: { _ in },
216-
password: "",
217-
onPasswordChanged: { _ in },
218-
onLoginTapped: {}
214+
password: ""
219215
)
220216
)
221217
.expect(
@@ -244,12 +240,10 @@ class AuthenticationWorkflowTests: XCTestCase {
244240
.expectWorkflow(
245241
type: LoginWorkflow.self,
246242
producingRendering: LoginScreen(
243+
actionSink: .noop(),
247244
title: "",
248245
email: "",
249-
onEmailChanged: { _ in },
250-
password: "",
251-
onPasswordChanged: { _ in },
252-
onLoginTapped: {}
246+
password: ""
253247
)
254248
)
255249
.expect(
@@ -275,12 +269,10 @@ class AuthenticationWorkflowTests: XCTestCase {
275269
.expectWorkflow(
276270
type: LoginWorkflow.self,
277271
producingRendering: LoginScreen(
272+
actionSink: .noop(),
278273
title: "",
279274
email: "",
280-
onEmailChanged: { _ in },
281-
password: "",
282-
onPasswordChanged: { _ in },
283-
onLoginTapped: {}
275+
password: ""
284276
)
285277
)
286278
.render { screen in

WorkflowSwiftUI/Sources/ObservableValue.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ public struct ScreenActionSink<Value>: Equatable {
113113
self.sink = sink
114114
}
115115

116+
public static func noop<T>() -> ScreenActionSink<T> {
117+
ScreenActionSink<T>(Sink { _ in })
118+
}
119+
116120
public func send(_ value: Value) {
117121
sink.send(value)
118122
}

0 commit comments

Comments
 (0)