mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-11 20:27:12 +01:00
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
|
import { strict as assert } from 'assert';
|
||
|
import migration58 from './058';
|
||
|
|
||
|
describe('migration #58', function () {
|
||
|
it('should update the version metadata', async function () {
|
||
|
const oldStorage = {
|
||
|
meta: {
|
||
|
version: 57,
|
||
|
},
|
||
|
data: {},
|
||
|
};
|
||
|
|
||
|
const newStorage = await migration58.migrate(oldStorage);
|
||
|
assert.deepEqual(newStorage.meta, {
|
||
|
version: 58,
|
||
|
});
|
||
|
});
|
||
|
|
||
|
describe('deleting swapsWelcomeMessageHasBeenShown', function () {
|
||
|
it('should delete the swapsWelcomeMessageHasBeenShown property', async function () {
|
||
|
const oldStorage = {
|
||
|
meta: {},
|
||
|
data: {
|
||
|
AppStateController: {
|
||
|
swapsWelcomeMessageHasBeenShown: false,
|
||
|
bar: 'baz',
|
||
|
},
|
||
|
foo: 'bar',
|
||
|
},
|
||
|
};
|
||
|
const newStorage = await migration58.migrate(oldStorage);
|
||
|
assert.deepEqual(newStorage.data.AppStateController, { bar: 'baz' });
|
||
|
});
|
||
|
|
||
|
it('should not modify state if the AppStateController does not exist', async function () {
|
||
|
const oldStorage = {
|
||
|
meta: {},
|
||
|
data: {
|
||
|
foo: 'bar',
|
||
|
},
|
||
|
};
|
||
|
const newStorage = await migration58.migrate(oldStorage);
|
||
|
assert.deepEqual(newStorage.data, oldStorage.data);
|
||
|
});
|
||
|
});
|
||
|
});
|