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.
73 lines
1.5 KiB
73 lines
1.5 KiB
4 years ago
|
import assert from 'assert';
|
||
4 years ago
|
import migration42 from './042';
|
||
5 years ago
|
|
||
|
describe('migration #42', function () {
|
||
|
it('should update the version metadata', function (done) {
|
||
|
const oldStorage = {
|
||
4 years ago
|
meta: {
|
||
|
version: 41,
|
||
5 years ago
|
},
|
||
4 years ago
|
data: {},
|
||
4 years ago
|
};
|
||
5 years ago
|
|
||
4 years ago
|
migration42
|
||
|
.migrate(oldStorage)
|
||
5 years ago
|
.then((newStorage) => {
|
||
|
assert.deepEqual(newStorage.meta, {
|
||
4 years ago
|
version: 42,
|
||
4 years ago
|
});
|
||
|
done();
|
||
5 years ago
|
})
|
||
4 years ago
|
.catch(done);
|
||
|
});
|
||
5 years ago
|
|
||
|
it('should set connectedStatusPopoverHasBeenShown to false', function (done) {
|
||
|
const oldStorage = {
|
||
|
meta: {},
|
||
|
data: {
|
||
|
AppStateController: {
|
||
|
connectedStatusPopoverHasBeenShown: true,
|
||
|
bar: 'baz',
|
||
|
},
|
||
|
foo: 'bar',
|
||
|
},
|
||
4 years ago
|
};
|
||
5 years ago
|
|
||
4 years ago
|
migration42
|
||
|
.migrate(oldStorage)
|
||
5 years ago
|
.then((newStorage) => {
|
||
|
assert.deepEqual(newStorage.data, {
|
||
|
AppStateController: {
|
||
|
connectedStatusPopoverHasBeenShown: false,
|
||
|
bar: 'baz',
|
||
|
},
|
||
|
foo: 'bar',
|
||
4 years ago
|
});
|
||
|
done();
|
||
5 years ago
|
})
|
||
4 years ago
|
.catch(done);
|
||
|
});
|
||
5 years ago
|
|
||
|
it('should initialize AppStateController if it does not exist', function (done) {
|
||
|
const oldStorage = {
|
||
|
meta: {},
|
||
|
data: {
|
||
|
foo: 'bar',
|
||
|
},
|
||
4 years ago
|
};
|
||
5 years ago
|
|
||
4 years ago
|
migration42
|
||
|
.migrate(oldStorage)
|
||
5 years ago
|
.then((newStorage) => {
|
||
|
assert.deepEqual(newStorage.data, {
|
||
|
foo: 'bar',
|
||
|
AppStateController: {
|
||
|
connectedStatusPopoverHasBeenShown: false,
|
||
|
},
|
||
4 years ago
|
});
|
||
|
done();
|
||
5 years ago
|
})
|
||
4 years ago
|
.catch(done);
|
||
|
});
|
||
|
});
|