1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 20:39:08 +01:00

Update the PhishingController to v2 tests

This commit is contained in:
PeterYinusa 2023-03-06 18:53:30 +00:00
parent ceab2a0b11
commit 64d8f359da

View File

@ -1,4 +1,4 @@
import { migrate, version } from './078';
import migration78 from './078';
describe('migration #78', () => {
it('updates the version metadata', async () => {
@ -9,10 +9,10 @@ describe('migration #78', () => {
data: {},
};
const newStorage = await migrate(oldStorage);
const newStorage = await migration78.migrate(oldStorage);
expect(newStorage.meta).toStrictEqual({
version,
version: 78,
});
});
@ -24,7 +24,7 @@ describe('migration #78', () => {
data: { test: '123' },
};
const newStorage = await migrate(oldStorage);
const newStorage = await migration78.migrate(oldStorage);
expect(newStorage.data).toStrictEqual(oldStorage.data);
});
@ -40,7 +40,7 @@ describe('migration #78', () => {
data: { PhishingController: invalidState },
};
const newStorage = await migrate(oldStorage);
const newStorage = await migration78.migrate(oldStorage);
expect(newStorage.data).toStrictEqual(oldStorage.data);
});
@ -54,7 +54,7 @@ describe('migration #78', () => {
data: { PhishingController: { test: '123' } },
};
const newStorage = await migrate(oldStorage);
const newStorage = await migration78.migrate(oldStorage);
expect(newStorage.data).toStrictEqual(oldStorage.data);
});
@ -67,7 +67,7 @@ describe('migration #78', () => {
data: { PhishingController: { test: '123', phishing: [] } },
};
const newStorage = await migrate(oldStorage);
const newStorage = await migration78.migrate(oldStorage);
expect(newStorage.data).toStrictEqual({
PhishingController: { test: '123' },
@ -82,7 +82,7 @@ describe('migration #78', () => {
data: { PhishingController: { test: '123', lastFetched: 100 } },
};
const newStorage = await migrate(oldStorage);
const newStorage = await migration78.migrate(oldStorage);
expect(newStorage.data).toStrictEqual({
PhishingController: { test: '123' },
@ -99,7 +99,7 @@ describe('migration #78', () => {
},
};
const newStorage = await migrate(oldStorage);
const newStorage = await migration78.migrate(oldStorage);
expect(newStorage.data).toStrictEqual({
PhishingController: { test: '123' },