You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.3 KiB
64 lines
1.3 KiB
2 years ago
|
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' },
|
||
|
},
|
||
|
});
|
||
|
});
|
||
|
});
|