forked from JSKitty/scc-web3
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix private mode on non-private wallets * Add e2e tests * Fix eslint warning * Commit this * Now it works please --------- Co-authored-by: Alessandro Rezzi <alessandrorezzi2000@gmail.com>
- Loading branch information
Showing
7 changed files
with
89 additions
and
25 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
describe('public/private mode tests', () => { | ||
beforeEach(() => { | ||
cy.clearDb(); | ||
cy.visit('/'); | ||
cy.waitForLoading().should('be.visible'); | ||
cy.playback('GET', /(xpub|address|getshielddata)/, { | ||
matching: { ignores: ['hostname', 'port'] }, | ||
}).as('sync'); | ||
cy.setExplorer(0); | ||
cy.setNode(1); | ||
cy.goToTab('dashboard'); | ||
cy.importWallet( | ||
'hawk crash art bottom rookie surprise grit giant fitness entire course spray' | ||
); | ||
cy.encryptWallet('123456'); | ||
|
||
cy.waitForSync(); | ||
cy.togglePrivateMode(); | ||
}); | ||
|
||
it('switches back to public mode when not available', () => { | ||
// We should be in private mode here | ||
cy.get('[data-testid="shieldModePrefix"]').should('exist'); | ||
cy.deleteWallet(); | ||
// When importing a non shield capable wallet, we should be in public mode | ||
cy.importWallet('DLabsktzGMnsK5K9uRTMCF6NoYNY6ET4Bb'); | ||
cy.get('[data-testid="shieldModePrefix"]').should('not.exist'); | ||
}); | ||
|
||
it('remembers private mode', () => { | ||
cy.visit('/'); | ||
cy.get('[data-testid="shieldModePrefix"]').should('exist'); | ||
}); | ||
}); |
Binary file added
BIN
+36.4 MB
...fixtures/e2e/private-mode-cy/public-private-mode-tests-remembers-private-mode.cy-playback
Binary file not shown.
Binary file added
BIN
+36.5 MB
...-cy/public-private-mode-tests-switches-back-to-public-mode-when-not-available.cy-playback
Binary file not shown.
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