Skip to content

Commit

Permalink
fix: remove step from Import (#1394)
Browse files Browse the repository at this point in the history
Signed-off-by: Hristiyan <[email protected]>
Signed-off-by: John Bair <[email protected]>
Co-authored-by: John Bair <[email protected]>
Co-authored-by: John Bair <[email protected]>
  • Loading branch information
3 people authored Jan 2, 2025
1 parent dbb1dd2 commit 3fbacb0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 61 deletions.
2 changes: 1 addition & 1 deletion automation/pages/SettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class SettingsPage extends BasePage {

while (attempt < maxRetries) {
await this.click(this.restoreButtonSelector);
if (await this.isElementVisible(this.continueButtonSelector, null, 3000)) {
if (await this.isElementVisible(this.continuePhraseButtonSelector, null, 3000)) {
return;
}
await new Promise(resolve => setTimeout(resolve, 2000));
Expand Down
31 changes: 7 additions & 24 deletions automation/tests/settingsTests.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,9 @@ test.describe('Settings tests', () => {
await settingsPage.clickOnKeysTab();

await settingsPage.clickOnRestoreButton();
await settingsPage.clickOnContinueButton();

const isMnemonicRequired = settingsPage.isElementVisible(
registrationPage.getRecoveryWordSelector(1),
);
if (isMnemonicRequired) {
await registrationPage.fillAllMissingRecoveryPhraseWords();
await settingsPage.clickOnContinuePhraseButton();
}
await registrationPage.fillAllMissingRecoveryPhraseWords();
await settingsPage.clickOnContinuePhraseButton();

await settingsPage.fillInIndex(settingsPage.currentIndex);
await settingsPage.clickOnIndexContinueButton();
Expand All @@ -97,15 +91,9 @@ test.describe('Settings tests', () => {
const rowCountBeforeRestore = await settingsPage.getKeyRowCount();

await settingsPage.clickOnRestoreButton();
await settingsPage.clickOnContinueButton();

const isMnemonicRequired = settingsPage.isElementVisible(
registrationPage.getRecoveryWordSelector(1),
);
if (isMnemonicRequired) {
await registrationPage.fillAllMissingRecoveryPhraseWords();
await settingsPage.clickOnContinuePhraseButton();
}
await registrationPage.fillAllMissingRecoveryPhraseWords();
await settingsPage.clickOnContinuePhraseButton();

await settingsPage.fillInIndex(settingsPage.currentIndex);
await settingsPage.clickOnIndexContinueButton();
Expand Down Expand Up @@ -140,15 +128,10 @@ test.describe('Settings tests', () => {
await settingsPage.clickOnKeysTab();

await settingsPage.clickOnRestoreButton();
await settingsPage.clickOnContinueButton();

const isMnemonicRequired = settingsPage.isElementVisible(
registrationPage.getRecoveryWordSelector(1),
);
if (isMnemonicRequired) {
await registrationPage.fillAllMissingRecoveryPhraseWords();
await settingsPage.clickOnContinuePhraseButton();
}
await registrationPage.fillAllMissingRecoveryPhraseWords();
await settingsPage.clickOnContinuePhraseButton();

const currentIndex = settingsPage.currentIndex;
await settingsPage.fillInIndex(settingsPage.currentIndex);
await settingsPage.clickOnIndexContinueButton();
Expand Down
41 changes: 5 additions & 36 deletions front-end/src/renderer/pages/RestoreKey/RestoreKey.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,38 +219,7 @@ watch(step, async newStep => {
<div class="flex-centered flex-column-100">
<Transition name="fade" mode="out-in">
<!-- Step 1 -->
<div v-if="step === 0" class="w-100">
<h1 class="text-display text-bold text-center">Restore Key Pair</h1>
<div
class="mt-5 w-100 d-flex flex-column justify-content-center align-items-center gap-4"
>
<div class="col-12 col-md-8 col-lg-6 col-xxl-4">
<AppButton
size="large"
data-testid="button-continue"
color="primary"
class="d-block w-100"
@click="user.recoveryPhrase ? (step += 2) : step++"
>Continue</AppButton
>
<AppButton
size="large"
data-testid="button-cancel"
color="secondary"
class="mt-4 d-block w-100"
@click="$router.back()"
>Cancel</AppButton
>
</div>
</div>
</div>

<!-- Step 2 -->
<form
v-else-if="step === 1"
@submit.prevent="handleImportRecoveryPhrase"
class="fill-remaining"
>
<form v-if="step === 0" @submit.prevent="handleImportRecoveryPhrase" class="fill-remaining">
<h1 class="text-display text-bold text-center">Enter your Recovery Phrase</h1>
<div class="mt-8">
<Import />
Expand Down Expand Up @@ -284,9 +253,9 @@ watch(step, async newStep => {
</div>
</form>

<!-- Step 3 -->
<!-- Step 2 -->
<form
v-else-if="step === 2"
v-else-if="step === 1"
class="w-100"
@submit.prevent="handleRestoreKey"
v-focus-first-input
Expand Down Expand Up @@ -322,9 +291,9 @@ watch(step, async newStep => {
</div>
</form>

<!-- Step 4 -->
<!-- Step 3 -->
<form
v-else-if="step === 3"
v-else-if="step === 2"
class="w-100"
@submit.prevent="handleSaveKey"
v-focus-first-input
Expand Down

0 comments on commit 3fbacb0

Please sign in to comment.