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.
57 lines
1.2 KiB
57 lines
1.2 KiB
4 years ago
|
import assert from 'assert';
|
||
4 years ago
|
import migration40 from './040';
|
||
5 years ago
|
|
||
|
describe('migration #40', function () {
|
||
|
it('should update the version metadata', function (done) {
|
||
|
const oldStorage = {
|
||
4 years ago
|
meta: {
|
||
|
version: 39,
|
||
5 years ago
|
},
|
||
4 years ago
|
data: {},
|
||
4 years ago
|
};
|
||
5 years ago
|
|
||
4 years ago
|
migration40
|
||
|
.migrate(oldStorage)
|
||
5 years ago
|
.then((newStorage) => {
|
||
|
assert.deepEqual(newStorage.meta, {
|
||
4 years ago
|
version: 40,
|
||
4 years ago
|
});
|
||
|
done();
|
||
5 years ago
|
})
|
||
4 years ago
|
.catch(done);
|
||
|
});
|
||
5 years ago
|
|
||
|
it('should delete ProviderApprovalController storage key', function (done) {
|
||
|
const oldStorage = {
|
||
4 years ago
|
meta: {},
|
||
|
data: {
|
||
|
ProviderApprovalController: {},
|
||
|
foo: 'bar',
|
||
5 years ago
|
},
|
||
4 years ago
|
};
|
||
5 years ago
|
|
||
4 years ago
|
migration40
|
||
|
.migrate(oldStorage)
|
||
5 years ago
|
.then((newStorage) => {
|
||
4 years ago
|
assert.deepEqual(newStorage.data, { foo: 'bar' });
|
||
|
done();
|
||
5 years ago
|
})
|
||
4 years ago
|
.catch(done);
|
||
|
});
|
||
5 years ago
|
|
||
|
it('should do nothing if no ProviderApprovalController storage key', function (done) {
|
||
|
const oldStorage = {
|
||
4 years ago
|
meta: {},
|
||
|
data: { foo: 'bar' },
|
||
4 years ago
|
};
|
||
5 years ago
|
|
||
4 years ago
|
migration40
|
||
|
.migrate(oldStorage)
|
||
5 years ago
|
.then((newStorage) => {
|
||
4 years ago
|
assert.deepEqual(newStorage.data, { foo: 'bar' });
|
||
|
done();
|
||
5 years ago
|
})
|
||
4 years ago
|
.catch(done);
|
||
|
});
|
||
|
});
|