Skip to content

Commit

Permalink
[settings] inverse app_context and hwm-switch
Browse files Browse the repository at this point in the history
In order to move all parameter information to the end of the flow as
required for useCaseHomeAndSettings
  • Loading branch information
spalmer25 committed Jul 25, 2024
1 parent 21079d8 commit 3c6a05e
Show file tree
Hide file tree
Showing 103 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions src/ui_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,6 @@ static bool navigation_cb_baking(uint8_t page, nbgl_pageContent_t* content) {

switch (page) {
case 0:
content->type = INFOS_LIST;
// Only the 3 first info are displayed on the first page
// will be removed in the next commit
content->infosList.nbInfos = 3;
content->infosList.infoTypes = infoTypes;
content->infosList.infoContents = (const char* const*) infoContents;
break;
case 1:
switches[HWM_ENABLED_TOKEN_ID].initState = (nbgl_state_t) (!hwm_disabled);
switches[HWM_ENABLED_TOKEN_ID].text = "High Watermark";
switches[HWM_ENABLED_TOKEN_ID].subText = "Track high watermark\n in Ledger";
Expand All @@ -129,6 +121,14 @@ static bool navigation_cb_baking(uint8_t page, nbgl_pageContent_t* content) {
content->switchesList.nbSwitches = SETTINGS_SWITCHES_NB;
content->switchesList.switches = (nbgl_layoutSwitch_t*) switches;
break;
case 1:
content->type = INFOS_LIST;
// Only the 3 first info are displayed on the first page
// will be removed in the next commit
content->infosList.nbInfos = 3;
content->infosList.infoTypes = infoTypes;
content->infosList.infoContents = (const char* const*) infoContents;
break;
case 2:
content->type = INFOS_LIST;
// Only the 3 last info are displayed on the third page
Expand Down
Binary file modified test/snapshots/flex/hwm_status_disabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/snapshots/flex/hwm_status_enabled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/snapshots/flex/test_review_home/app_context.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/snapshots/stax/hwm_status_disabled.png
Binary file modified test/snapshots/stax/hwm_status_enabled.png
Binary file modified test/snapshots/stax/test_review_home/app_context.png
23 changes: 10 additions & 13 deletions test/test_instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,44 +155,41 @@ def test_review_home(account: Optional[Account],
backend.wait_for_home_screen()
tezos_navigator.home.settings()
backend.wait_for_screen_change()
tezos_navigator.assert_screen("app_context", snap_path)
tezos_navigator.assert_screen(TouchFixedScreen.SETTINGS_HMW_ENABLED)
tezos_navigator.settings.next()
backend.wait_for_screen_change()
tezos_navigator.assert_screen(TouchFixedScreen.SETTINGS_HMW_ENABLED)
tezos_navigator.assert_screen("app_context", snap_path)
tezos_navigator.settings.next()
backend.wait_for_screen_change()
tezos_navigator.assert_screen(TouchFixedScreen.SETTINGS_DESCRIPTION)
tezos_navigator.settings.previous()
backend.wait_for_screen_change()
tezos_navigator.assert_screen(TouchFixedScreen.SETTINGS_HMW_ENABLED)
tezos_navigator.assert_screen("app_context", snap_path)
tezos_navigator.settings.previous()
backend.wait_for_screen_change()
tezos_navigator.assert_screen("app_context", snap_path)
tezos_navigator.assert_screen(TouchFixedScreen.SETTINGS_HMW_ENABLED)
tezos_navigator.settings.exit()
backend.wait_for_screen_change()
tezos_navigator.assert_screen(TouchFixedScreen.HOME)
tezos_navigator.home.settings()
backend.wait_for_screen_change()
tezos_navigator.assert_screen("app_context", snap_path)
tezos_navigator.settings.next()
backend.wait_for_screen_change()
tezos_navigator.assert_screen(TouchFixedScreen.SETTINGS_HMW_ENABLED)
tezos_navigator.settings.toggle_hwm_status()
backend.wait_for_screen_change()
tezos_navigator.assert_screen(TouchFixedScreen.SETTINGS_HMW_DISABLED)
tezos_navigator.settings.next()
backend.wait_for_screen_change()
tezos_navigator.assert_screen("app_context", snap_path)
tezos_navigator.settings.next()
backend.wait_for_screen_change()
tezos_navigator.assert_screen(TouchFixedScreen.SETTINGS_DESCRIPTION)
tezos_navigator.settings.previous()
backend.wait_for_screen_change()
tezos_navigator.assert_screen(TouchFixedScreen.SETTINGS_HMW_DISABLED)
tezos_navigator.settings.toggle_hwm_status()
backend.wait_for_screen_change()
tezos_navigator.assert_screen(TouchFixedScreen.SETTINGS_HMW_ENABLED)
tezos_navigator.assert_screen("app_context", snap_path)
tezos_navigator.settings.previous()
backend.wait_for_screen_change()
tezos_navigator.assert_screen("app_context", snap_path)
tezos_navigator.settings.next()
tezos_navigator.assert_screen(TouchFixedScreen.SETTINGS_HMW_DISABLED)
tezos_navigator.settings.toggle_hwm_status()
backend.wait_for_screen_change()
tezos_navigator.assert_screen(TouchFixedScreen.SETTINGS_HMW_ENABLED)
tezos_navigator.settings.exit()
Expand Down
9 changes: 6 additions & 3 deletions test/utils/navigator.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ def goto_home_public_key(self) -> Generator[None, None, None]:
self.assert_screen(TouchFixedScreen.HOME)
self.home.settings()
self.backend.wait_for_screen_change()
# hwm_status
self.settings.next()
self.backend.wait_for_screen_change()

yield

Expand Down Expand Up @@ -339,6 +342,9 @@ def goto_home_hwm(self) -> Generator[None, None, None]:
self.assert_screen(TouchFixedScreen.HOME)
self.home.settings()
self.backend.wait_for_screen_change()
# hwm_status
self.settings.next()
self.backend.wait_for_screen_change()

yield

Expand Down Expand Up @@ -564,9 +570,6 @@ def disable_hwm(self) -> None:
self.backend.wait_for_home_screen()
self.home.settings()
self.backend.wait_for_screen_change()
# app_context
self.settings.next()
self.backend.wait_for_screen_change()
self.assert_screen(TouchFixedScreen.SETTINGS_HMW_ENABLED)
self.settings.toggle_hwm_status()
self.backend.wait_for_screen_change()
Expand Down

0 comments on commit 3c6a05e

Please sign in to comment.