diff options
Diffstat (limited to 'test/unit/metamask-controller-test.js')
-rw-r--r-- | test/unit/metamask-controller-test.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/unit/metamask-controller-test.js b/test/unit/metamask-controller-test.js index ef6cae758..548b5f87f 100644 --- a/test/unit/metamask-controller-test.js +++ b/test/unit/metamask-controller-test.js @@ -27,6 +27,24 @@ describe('MetaMaskController', function () { describe('Metamask Controller', function () { assert(metamaskController) + + describe('#createNewVaultAndKeychain', function () { + it('can only create new vault on keyringController once', async function () { + + const selectStub = sinon.stub(metamaskController, 'selectFirstIdentity') + + const expectation = sinon.mock(metamaskController.keyringController) + .expects('createNewVaultAndKeychain').once() + + const password = 'a-fake-password' + + const first = await metamaskController.createNewVaultAndKeychain(password) + const second = await metamaskController.createNewVaultAndKeychain(password) + + expectation.verify() + selectStub.reset() + }) + }) }) }) |