Skip to content

Commit af191b3

Browse files
Merge pull request #101 from 72A12F4E/main
Tutorial Formatting Fixes
2 parents 096c676 + 8d7c483 commit af191b3

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

Diff for: Samples/Tutorial/Tutorial4.md

+6
Original file line numberDiff line numberDiff line change
@@ -413,3 +413,9 @@ Is the code better after this refactor? It's debatable - having the logic in the
413413
Additionally, now the `TodoList` and `TodoEdit` workflows are completely decoupled - there is no longer a requirement that the `TodoEdit` workflow is displayed after the list. For instance, we could change the list to have "viewing" or "editing" modes, where tapping on an item might only allow it to be viewed, but another mode would allow editing.
414414

415415
It comes down to the individual judgement of the developer to decide how a tree of workflows should be shaped - this was intended to provide two examples of how this _could_ be structured, but not specify how it _should_.
416+
417+
## Up Next
418+
419+
We now have a pretty fully formed app. However, if we want to keep adding features, we'll want to validate that existing features don't break while we're making improvements. In the next tutorial, we'll cover a couple of techniques for testing workflows.
420+
421+
[Tutorial 5](Tutorial5.md)

Diff for: Samples/Tutorial/Tutorial5.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -578,24 +578,24 @@ class TodoWorkflowTests: XCTestCase {
578578
step: .list
579579
))
580580
// We only expect the TodoListWorkflow to be rendered.
581-
.expectWorkflow(
582-
type: TodoListWorkflow.self,
583-
producingRendering: BackStackScreen<AnyScreen>.Item(
584-
screen: TodoListScreen(todoTitles: ["Title"], onTodoSelected: { _ in }).asAnyScreen()
585-
),
586-
// Simulate selecting the first todo.
587-
producingOutput: .selectTodo(index: 0)
588-
)
589-
.render { items in
590-
// Just validate that there is one item in the back stack.
591-
// Additional validation could be done on the screens returned, if desired.
592-
XCTAssertEqual(1, items.count)
593-
}
594-
// Assert that the state was updated after the render pass with the output from the TodoListWorkflow.
595-
.assert(state: TodoWorkflow.State(
596-
todos: [TodoModel(title: "Title", note: "Note")],
597-
step: .edit(index: 0)
598-
))
581+
.expectWorkflow(
582+
type: TodoListWorkflow.self,
583+
producingRendering: BackStackScreen<AnyScreen>.Item(
584+
screen: TodoListScreen(todoTitles: ["Title"], onTodoSelected: { _ in }).asAnyScreen()
585+
),
586+
// Simulate selecting the first todo.
587+
producingOutput: .selectTodo(index: 0)
588+
)
589+
.render { items in
590+
// Just validate that there is one item in the back stack.
591+
// Additional validation could be done on the screens returned, if desired.
592+
XCTAssertEqual(1, items.count)
593+
}
594+
// Assert that the state was updated after the render pass with the output from the TodoListWorkflow.
595+
.assert(state: TodoWorkflow.State(
596+
todos: [TodoModel(title: "Title", note: "Note")],
597+
step: .edit(index: 0)
598+
))
599599
}
600600

601601
func testSavingTodo() throws {

0 commit comments

Comments
 (0)