-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Leverage dynamic case writability in example code (#2885)
* Support chainable writability for dynamic case lookup * wip * wip * wip * wip
- Loading branch information
1 parent
dfe8e57
commit 9f849e7
Showing
11 changed files
with
33 additions
and
93 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,28 +18,20 @@ final class AppCoreTests: XCTestCase { | |
} | ||
|
||
await store.send(\.login.view.email, "[email protected]") { | ||
$0.modify(\.login) { | ||
$0.email = "[email protected]" | ||
} | ||
$0.login?.email = "[email protected]" | ||
} | ||
await store.send(\.login.view.password, "bl0bbl0b") { | ||
$0.modify(\.login) { | ||
$0.password = "bl0bbl0b" | ||
$0.isFormValid = true | ||
} | ||
$0.login?.password = "bl0bbl0b" | ||
$0.login?.isFormValid = true | ||
} | ||
await store.send(\.login.view.loginButtonTapped) { | ||
$0.modify(\.login) { | ||
$0.isLoginRequestInFlight = true | ||
} | ||
$0.login?.isLoginRequestInFlight = true | ||
} | ||
await store.receive(\.login.loginResponse.success) { | ||
$0 = .newGame(NewGame.State()) | ||
} | ||
await store.send(\.newGame.oPlayerName, "Blob Sr.") { | ||
$0.modify(\.newGame) { | ||
$0.oPlayerName = "Blob Sr." | ||
} | ||
$0.newGame?.oPlayerName = "Blob Sr." | ||
} | ||
await store.send(\.newGame.logoutButtonTapped) { | ||
$0 = .login(Login.State()) | ||
|
@@ -59,41 +51,29 @@ final class AppCoreTests: XCTestCase { | |
} | ||
|
||
await store.send(\.login.view.email, "[email protected]") { | ||
$0.modify(\.login) { | ||
$0.email = "[email protected]" | ||
} | ||
$0.login?.email = "[email protected]" | ||
} | ||
|
||
await store.send(\.login.view.password, "bl0bbl0b") { | ||
$0.modify(\.login) { | ||
$0.password = "bl0bbl0b" | ||
$0.isFormValid = true | ||
} | ||
$0.login?.password = "bl0bbl0b" | ||
$0.login?.isFormValid = true | ||
} | ||
|
||
await store.send(\.login.view.loginButtonTapped) { | ||
$0.modify(\.login) { | ||
$0.isLoginRequestInFlight = true | ||
} | ||
$0.login?.isLoginRequestInFlight = true | ||
} | ||
await store.receive(\.login.loginResponse.success) { | ||
$0.modify(\.login) { | ||
$0.isLoginRequestInFlight = false | ||
$0.twoFactor = TwoFactor.State(token: "deadbeef") | ||
} | ||
$0.login?.isLoginRequestInFlight = false | ||
$0.login?.twoFactor = TwoFactor.State(token: "deadbeef") | ||
} | ||
|
||
await store.send(\.login.twoFactor.view.code, "1234") { | ||
$0.modify(\.login) { | ||
$0.twoFactor?.code = "1234" | ||
$0.twoFactor?.isFormValid = true | ||
} | ||
$0.login?.twoFactor?.code = "1234" | ||
$0.login?.twoFactor?.isFormValid = true | ||
} | ||
|
||
await store.send(\.login.twoFactor.view.submitButtonTapped) { | ||
$0.modify(\.login) { | ||
$0.twoFactor?.isTwoFactorRequestInFlight = true | ||
} | ||
$0.login?.twoFactor?.isTwoFactorRequestInFlight = true | ||
} | ||
await store.receive(\.login.twoFactor.twoFactorResponse.success) { | ||
$0 = .newGame(NewGame.State()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters