1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00
metamask-extension/app/scripts/migrations/075.test.js

64 lines
1.3 KiB
JavaScript
Raw Permalink Normal View History

import migration75 from './075';
describe('migration #75', () => {
it('should update the version metadata', async () => {
const oldStorage = {
meta: {
version: 74,
},
data: {},
};
const newStorage = await migration75.migrate(oldStorage);
expect(newStorage.meta).toStrictEqual({
version: 75,
});
});
it('should delete the ThreeBoxController', async () => {
const oldStorage = {
meta: {
version: 74,
},
data: {
FooController: { a: 'b' },
ThreeBoxController: {
stuff: 'stuff!',
moreStuff: { moreStuff: ['stuff', 'stuff', 'stuff'] },
},
},
};
const newStorage = await migration75.migrate(oldStorage);
expect(newStorage).toStrictEqual({
meta: {
version: 75,
},
data: {
FooController: { a: 'b' },
},
});
});
it('should handle missing ThreeBoxController', async () => {
const oldStorage = {
meta: {
version: 74,
},
data: {
FooController: { a: 'b' },
},
};
const newStorage = await migration75.migrate(oldStorage);
expect(newStorage).toStrictEqual({
meta: {
version: 75,
},
data: {
FooController: { a: 'b' },
},
});
});
});