aboutsummaryrefslogtreecommitdiff
path: root/test/background
diff options
context:
space:
mode:
Diffstat (limited to 'test/background')
-rw-r--r--test/background/domains/GlobalMark.test.ts11
-rw-r--r--test/background/repositories/Mark.test.ts3
-rw-r--r--test/background/repositories/Version.ts34
3 files changed, 1 insertions, 47 deletions
diff --git a/test/background/domains/GlobalMark.test.ts b/test/background/domains/GlobalMark.test.ts
deleted file mode 100644
index ed636e9..0000000
--- a/test/background/domains/GlobalMark.test.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import GlobalMark from 'background/domains/GlobalMark';
-
-describe('background/domains/global-mark', () => {
- describe('constructor and getter', () => {
- let mark = new GlobalMark(1, 'http://example.com', 10, 30);
- expect(mark.tabId).to.equal(1);
- expect(mark.url).to.equal('http://example.com');
- expect(mark.x).to.equal(10);
- expect(mark.y).to.equal(30);
- });
-});
diff --git a/test/background/repositories/Mark.test.ts b/test/background/repositories/Mark.test.ts
index 2a5b099..167e512 100644
--- a/test/background/repositories/Mark.test.ts
+++ b/test/background/repositories/Mark.test.ts
@@ -9,12 +9,11 @@ describe('background/repositories/mark', () => {
});
it('get and set', async() => {
- let mark = new GlobalMark(1, 'http://example.com', 10, 30);
+ let mark = { tabId: 1, url: 'http://example.com', x: 10, y: 30 };
repository.setMark('A', mark);
let got = await repository.getMark('A');
- expect(got).to.be.a('object');
expect(got.tabId).to.equal(1);
expect(got.url).to.equal('http://example.com');
expect(got.x).to.equal(10);
diff --git a/test/background/repositories/Version.ts b/test/background/repositories/Version.ts
deleted file mode 100644
index c7fa88b..0000000
--- a/test/background/repositories/Version.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import VersionRepository from 'background/repositories/Version';
-
-describe("background/repositories/version", () => {
- let versionRepository;
-
- beforeEach(() => {
- versionRepository = new VersionRepository;
- });
-
- describe('#get', () => {
- beforeEach(() => {
- return browser.storage.local.remove('version');
- });
-
- it('loads saved version', async() => {
- await browser.storage.local.set({ version: '1.2.3' });
- let version = await this.versionRepository.get();
- 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('#update', () => {
- it('saves version string', async() => {
- await versionRepository.update('2.3.4');
- let { version } = await browser.storage.local.get('version');
- expect(version).to.equal('2.3.4');
- });
- });
-});