Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove cancel warning on Keycard onboarding #12257

Merged
merged 1 commit into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions src/status_im/keycard/onboarding.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -315,19 +315,9 @@
[{:keys [db] :as cofx}]
{:db (update db :keycard dissoc :factory-reset-card?)})

(fx/defn cancel-confirm
{:events [::cancel-confirm]}
(fx/defn cancel-pressed
{:events [::cancel-pressed]}
[cofx]
(fx/merge cofx
(navigation/navigate-back)
(common/cancel-sheet-confirm)))

(fx/defn cancel-pressed
{:events [::cancel-pressed]}
[_]
{:ui/show-confirmation {:title (i18n/label :t/keycard-cancel-setup-title)
:content (i18n/label :t/keycard-cancel-setup-text)
:confirm-button-text (i18n/label :t/yes)
:cancel-button-text (i18n/label :t/no)
:on-accept #(re-frame/dispatch [::cancel-confirm])
:on-cancel #()}})
16 changes: 3 additions & 13 deletions src/status_im/keycard/recovery.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,13 @@
:keycard/check-nfc-enabled nil}
(navigation/navigate-to-cofx :keycard-onboarding-intro nil)))

(fx/defn cancel-confirm
{:events [::cancel-confirm]}
[{:keys [db] :as cofx}]
(fx/defn cancel-pressed
{:events [::cancel-pressed]}
[cofx]
(fx/merge cofx
(common/cancel-sheet-confirm)
(navigation/navigate-back)))

(fx/defn cancel-pressed
{:events [::cancel-pressed]}
[_]
{:ui/show-confirmation {:title (i18n/label :t/keycard-cancel-setup-title)
:content (i18n/label :t/keycard-cancel-setup-text)
:confirm-button-text (i18n/label :t/yes)
:cancel-button-text (i18n/label :t/no)
:on-accept #(re-frame/dispatch [::cancel-confirm])
:on-cancel #()}})

(fx/defn begin-setup-pressed
{:events [:keycard.recovery.intro.ui/begin-recovery-pressed]}
[{:keys [db] :as cofx}]
Expand Down
10 changes: 0 additions & 10 deletions test/appium/tests/atomic/account_management/test_keycard.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ def test_keycard_interruption_creating_onboarding_flow(self):
keycard_flow.connect_card_button.click()
keycard_flow.enter_another_pin()
keycard_flow.cancel_button.click()
if not keycard_flow.element_by_translation_id("keycard-cancel-setup-title").is_element_displayed():
self.driver.fail('No Dangerous operation popup is shown on canceling operation from PIN code stage')
keycard_flow.yes_button.click()

sign_in.just_fyi('Cancel from Confirm seed phrase: initialized + 1 pairing slot is used')
keycard_flow.begin_setup_button.click()
Expand All @@ -161,15 +158,11 @@ def test_keycard_interruption_creating_onboarding_flow(self):
keycard_flow.confirm_button.click()
keycard_flow.yes_button.click()
keycard_flow.cancel_button.click()
if not keycard_flow.element_by_translation_id("keycard-cancel-setup-title").is_element_displayed():
self.driver.fail('No Dangerous operation popup is shown on canceling operation during Backup seed phrase stage')
keycard_flow.yes_button.click()
if not keycard_flow.element_by_text_part('Back up seed phrase').is_element_displayed():
self.driver.fail('On canceling setup from Confirm seed phrase was not redirected to expected screen')

sign_in.just_fyi('Cancel from Back Up seed phrase: initialized + 1 pairing slot is used')
keycard_flow.cancel_button.click()
keycard_flow.yes_button.click()
keycard_flow.begin_setup_button.click()
keycard_flow.element_by_translation_id("back-up-seed-phrase").wait_for_element(10)
new_seed_phrase = keycard_flow.get_seed_phrase()
Expand Down Expand Up @@ -214,9 +207,6 @@ def test_keycard_interruption_access_key_onboarding_flow(self):
keycard_flow.connect_card_button.click()
keycard_flow.enter_another_pin()
keycard_flow.cancel_button.click()
if not keycard_flow.element_by_translation_id("keycard-cancel-setup-title").is_element_displayed():
self.driver.fail('No Dangerous operation popup is shown on canceling operation from PIN code stage')
keycard_flow.yes_button.click()

sign_in.just_fyi('Finish setup and relogin')
keycard_flow.begin_setup_button.click()
Expand Down