aboutsummaryrefslogtreecommitdiff
path: root/test/shared/versions
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-07-13 22:30:05 +0900
committerGitHub <noreply@github.com>2018-07-13 22:30:05 +0900
commit28bfa3ac8124d3453cd539db26da4f4703e783df (patch)
treedd4461af8343a7d5c9fc13cc51cd0fd5edd0285e /test/shared/versions
parent37840c2abb02948d36cdcfaab9063f3ea67fdb6b (diff)
parent803e6ea7af60107182356b5fda8e3c2ddfacaefa (diff)
Merge pull request #431 from ueokande/command-completions
Command completions
Diffstat (limited to 'test/shared/versions')
-rw-r--r--test/shared/versions/index.test.js40
-rw-r--r--test/shared/versions/storage.test.js28
2 files changed, 0 insertions, 68 deletions
diff --git a/test/shared/versions/index.test.js b/test/shared/versions/index.test.js
deleted file mode 100644
index d90f04c..0000000
--- a/test/shared/versions/index.test.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import * as versions from 'shared/versions';
-import manifest from '../../../manifest.json';
-
-describe("shared/versions/storage", () => {
- describe('#checkUpdated', () => {
- beforeEach(() => {
- return browser.storage.local.remove('version');
- });
-
- it('return true if no previous versions', async() => {
- let updated = await versions.checkUpdated();
- expect(updated).to.be.true;
- });
-
- it('return true if updated', async() => {
- await browser.storage.local.set({ version: '0.001' });
- let updated = await versions.checkUpdated();
- expect(updated).to.be.true;
- });
-
- it('return false if not updated', async() => {
- await browser.storage.local.set({ version: manifest.version });
- let updated = await versions.checkUpdated();
- expect(updated).to.be.false;
- });
- });
-
- describe('#commit', () => {
- beforeEach(() => {
- return browser.storage.local.remove('version');
- });
-
- it('saves current version from manifest.json', async() => {
- await versions.commit();
- let { version } = await browser.storage.local.get('version');
- expect(version).to.be.a('string');
- expect(version).to.equal(manifest.version);
- });
- });
-});
diff --git a/test/shared/versions/storage.test.js b/test/shared/versions/storage.test.js
deleted file mode 100644
index f541abf..0000000
--- a/test/shared/versions/storage.test.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import * as storage from 'shared/versions/storage';
-
-describe("shared/versions/storage", () => {
- describe('#load', () => {
- beforeEach(() => {
- return browser.storage.local.remove('version');
- });
-
- 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');
- });
-
- it('returns undefined if no versions in storage', async() => {
- let version = await storage.load();
- expect(version).to.be.a('undefined');
- });
- });
-
- describe('#save', () => {
- 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');
- });
- });
-});