From c60d0e7392fc708e961614d6b756a045de74f458 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Tue, 30 Apr 2019 14:00:07 +0900 Subject: Rename .js/.jsx to .ts/.tsx --- test/background/repositories/Mark.test.js | 26 ----------------------- test/background/repositories/Mark.test.ts | 26 +++++++++++++++++++++++ test/background/repositories/Version.js | 34 ------------------------------- test/background/repositories/Version.ts | 34 +++++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 60 deletions(-) delete mode 100644 test/background/repositories/Mark.test.js create mode 100644 test/background/repositories/Mark.test.ts delete mode 100644 test/background/repositories/Version.js create mode 100644 test/background/repositories/Version.ts (limited to 'test/background/repositories') diff --git a/test/background/repositories/Mark.test.js b/test/background/repositories/Mark.test.js deleted file mode 100644 index 2a5b099..0000000 --- a/test/background/repositories/Mark.test.js +++ /dev/null @@ -1,26 +0,0 @@ -import MarkRepository from 'background/repositories/MarkRepository'; -import GlobalMark from 'background/domains/GlobalMark'; - -describe('background/repositories/mark', () => { - let repository; - - beforeEach(() => { - repository = new MarkRepository; - }); - - it('get and set', async() => { - let mark = new GlobalMark(1, 'http://example.com', 10, 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); - expect(got.y).to.equal(30); - - got = await repository.getMark('B'); - expect(got).to.be.undefined; - }); -}); diff --git a/test/background/repositories/Mark.test.ts b/test/background/repositories/Mark.test.ts new file mode 100644 index 0000000..2a5b099 --- /dev/null +++ b/test/background/repositories/Mark.test.ts @@ -0,0 +1,26 @@ +import MarkRepository from 'background/repositories/MarkRepository'; +import GlobalMark from 'background/domains/GlobalMark'; + +describe('background/repositories/mark', () => { + let repository; + + beforeEach(() => { + repository = new MarkRepository; + }); + + it('get and set', async() => { + let mark = new GlobalMark(1, 'http://example.com', 10, 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); + expect(got.y).to.equal(30); + + got = await repository.getMark('B'); + expect(got).to.be.undefined; + }); +}); diff --git a/test/background/repositories/Version.js b/test/background/repositories/Version.js deleted file mode 100644 index c7fa88b..0000000 --- a/test/background/repositories/Version.js +++ /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'); - }); - }); -}); diff --git a/test/background/repositories/Version.ts b/test/background/repositories/Version.ts new file mode 100644 index 0000000..c7fa88b --- /dev/null +++ b/test/background/repositories/Version.ts @@ -0,0 +1,34 @@ +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'); + }); + }); +}); -- cgit v1.2.3