A fork of https://github.com/ueokande/vim-vixen
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.
29 lines
820 B
29 lines
820 B
7 years ago
|
import * as storage from 'background/shared/versions/storage';
|
||
7 years ago
|
|
||
|
describe("shared/versions/storage", () => {
|
||
|
describe('#load', () => {
|
||
|
beforeEach(() => {
|
||
|
return browser.storage.local.remove('version');
|
||
|
});
|
||
|
|
||
7 years ago
|
it('loads saved version', async() => {
|
||
|
await browser.storage.local.set({ version: '1.2.3' });
|
||
|
let version = await storage.load();
|
||
|
expect(version).to.equal('1.2.3');
|
||
7 years ago
|
});
|
||
|
|
||
7 years ago
|
it('returns undefined if no versions in storage', async() => {
|
||
|
let version = await storage.load();
|
||
|
expect(version).to.be.a('undefined');
|
||
7 years ago
|
});
|
||
|
});
|
||
|
|
||
|
describe('#save', () => {
|
||
7 years ago
|
it('saves version string', async() => {
|
||
|
await storage.save('2.3.4');
|
||
|
let { version } = await browser.storage.local.get('version');
|
||
|
expect(version).to.equal('2.3.4');
|
||
7 years ago
|
});
|
||
|
});
|
||
|
});
|