mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add failing test for unknown identity entry
This commit is contained in:
parent
5d58f0e9a0
commit
797e63b37b
@ -45,7 +45,7 @@ describe('MetaMaskController', function () {
|
|||||||
encryptor: {
|
encryptor: {
|
||||||
encrypt: function (password, object) {
|
encrypt: function (password, object) {
|
||||||
this.object = object
|
this.object = object
|
||||||
return Promise.resolve()
|
return Promise.resolve('mock-encrypted')
|
||||||
},
|
},
|
||||||
decrypt: function () {
|
decrypt: function () {
|
||||||
return Promise.resolve(this.object)
|
return Promise.resolve(this.object)
|
||||||
@ -62,6 +62,31 @@ describe('MetaMaskController', function () {
|
|||||||
sandbox.restore()
|
sandbox.restore()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('submitPassword', function () {
|
||||||
|
const password = 'password'
|
||||||
|
|
||||||
|
beforeEach(async function () {
|
||||||
|
await metamaskController.createNewVaultAndKeychain(password)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('removes any identities that do not correspond to known accounts.', async function () {
|
||||||
|
const fakeAddress = '0xbad0'
|
||||||
|
metamaskController.preferencesController.addAddresses([fakeAddress])
|
||||||
|
await metamaskController.submitPassword(password)
|
||||||
|
|
||||||
|
const identities = Object.keys(metamaskController.preferencesController.store.getState().identities)
|
||||||
|
const addresses = await metamaskController.keyringController.getAccounts()
|
||||||
|
|
||||||
|
identities.forEach((identity) => {
|
||||||
|
assert.ok(addresses.includes(identity), `addresses should include all IDs: ${identity}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
addresses.forEach((address) => {
|
||||||
|
assert.ok(identities.includes(address), `identities should include all Addresses: ${address}`)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('#getGasPrice', function () {
|
describe('#getGasPrice', function () {
|
||||||
|
|
||||||
it('gives the 50th percentile lowest accepted gas price from recentBlocksController', async function () {
|
it('gives the 50th percentile lowest accepted gas price from recentBlocksController', async function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user