1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-30 08:09:15 +01:00
metamask-extension/app/scripts/migrations/046.test.js

52 lines
1.1 KiB
JavaScript
Raw Normal View History

import migration46 from './046';
describe('migration #46', () => {
it('should update the version metadata', async () => {
const oldStorage = {
2020-11-03 00:41:28 +01:00
meta: {
version: 45,
},
2020-11-03 00:41:28 +01:00
data: {},
};
const newStorage = await migration46.migrate(oldStorage);
expect(newStorage.meta).toStrictEqual({
2020-11-03 00:41:28 +01:00
version: 46,
});
});
it('should delete ABTestController state', async () => {
const oldStorage = {
meta: {},
data: {
ABTestController: {
abTests: {
fullScreenVsPopup: 'control',
},
},
foo: 'bar',
},
};
const newStorage = await migration46.migrate(oldStorage);
expect(newStorage.data).toStrictEqual({
foo: 'bar',
});
});
it('should do nothing if ABTestController state does not exist', async () => {
const oldStorage = {
meta: {},
data: {
AppStateController: {
bar: 'baz',
},
foo: 'bar',
},
};
const newStorage = await migration46.migrate(oldStorage);
expect(oldStorage.data).toStrictEqual(newStorage.data);
});
});