From 992712d250b21d3628ec687ef8e1cdc176065f54 Mon Sep 17 00:00:00 2001 From: Blake McAnally Date: Thu, 23 Sep 2021 00:34:21 -0500 Subject: [PATCH 1/2] Add link from tutorial 4 to tutorial 5, and fix indentation on a code snippet --- Samples/Tutorial/Tutorial4.md | 6 ++++++ Samples/Tutorial/Tutorial5.md | 36 +++++++++++++++++------------------ 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/Samples/Tutorial/Tutorial4.md b/Samples/Tutorial/Tutorial4.md index 3f74690da..ff38b8dbc 100644 --- a/Samples/Tutorial/Tutorial4.md +++ b/Samples/Tutorial/Tutorial4.md @@ -413,3 +413,9 @@ Is the code better after this refactor? It's debatable - having the logic in the 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. 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_. + +## Up Next + +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 make improvements. In the next tutorial, we'll cover a couple of techniques for testing workflows. + +[Tutorial 5](Tutorial5.md) \ No newline at end of file diff --git a/Samples/Tutorial/Tutorial5.md b/Samples/Tutorial/Tutorial5.md index baa7f9008..7996ad045 100644 --- a/Samples/Tutorial/Tutorial5.md +++ b/Samples/Tutorial/Tutorial5.md @@ -578,24 +578,24 @@ class TodoWorkflowTests: XCTestCase { step: .list )) // We only expect the TodoListWorkflow to be rendered. - .expectWorkflow( - type: TodoListWorkflow.self, - producingRendering: BackStackScreen.Item( - screen: TodoListScreen(todoTitles: ["Title"], onTodoSelected: { _ in }).asAnyScreen() - ), - // Simulate selecting the first todo. - producingOutput: .selectTodo(index: 0) - ) - .render { items in - // Just validate that there is one item in the back stack. - // Additional validation could be done on the screens returned, if desired. - XCTAssertEqual(1, items.count) - } - // Assert that the state was updated after the render pass with the output from the TodoListWorkflow. - .assert(state: TodoWorkflow.State( - todos: [TodoModel(title: "Title", note: "Note")], - step: .edit(index: 0) - )) + .expectWorkflow( + type: TodoListWorkflow.self, + producingRendering: BackStackScreen.Item( + screen: TodoListScreen(todoTitles: ["Title"], onTodoSelected: { _ in }).asAnyScreen() + ), + // Simulate selecting the first todo. + producingOutput: .selectTodo(index: 0) + ) + .render { items in + // Just validate that there is one item in the back stack. + // Additional validation could be done on the screens returned, if desired. + XCTAssertEqual(1, items.count) + } + // Assert that the state was updated after the render pass with the output from the TodoListWorkflow. + .assert(state: TodoWorkflow.State( + todos: [TodoModel(title: "Title", note: "Note")], + step: .edit(index: 0) + )) } func testSavingTodo() throws { From 8d7c48399eb9de09d7a3def8001a8c60dbc35597 Mon Sep 17 00:00:00 2001 From: Blake McAnally Date: Thu, 23 Sep 2021 09:53:10 -0500 Subject: [PATCH 2/2] Update Samples/Tutorial/Tutorial4.md Co-authored-by: Stephen Edwards --- Samples/Tutorial/Tutorial4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Samples/Tutorial/Tutorial4.md b/Samples/Tutorial/Tutorial4.md index ff38b8dbc..75d3c004f 100644 --- a/Samples/Tutorial/Tutorial4.md +++ b/Samples/Tutorial/Tutorial4.md @@ -416,6 +416,6 @@ It comes down to the individual judgement of the developer to decide how a tree ## Up Next -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 make improvements. In the next tutorial, we'll cover a couple of techniques for testing workflows. +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. [Tutorial 5](Tutorial5.md) \ No newline at end of file