1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00
metamask-extension/app/scripts/migrations/075.test.js
Erik Marks a8c1756816
Remove 3box feature and delete ThreeBoxController (#14571)
* Remove 3box feature and delete ThreeBoxController

Lint locale messages

lavamoat policy updates

* Restore 3Box user trait with value `false`

The 3Box user trait has been restored and hard-coded as `false`. This
ensures that users don't get stuck in our metrics as having this trait.

A deprecation comment has been left in various places for this trait.

* Remove unused state

* Remove additional 3box-related things

* Run `yarn-deduplicate`

* Restore migration that was lost while rebasing

* Remove obsolete override

* Remove additional unused resolutions/dependencies

* Update LavaMoat policies

* Remove obsolete security advisory ignore entries

* Remove 3Box fixture builder method

* Update unit tests

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2022-10-31 13:50:50 -02:30

64 lines
1.3 KiB
JavaScript

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' },
},
});
});
});