Scroll on global mark and handle gone tab
This commit is contained in:
parent
003742ec51
commit
e248477ecb
9 changed files with 49 additions and 13 deletions
|
@ -1,9 +1,10 @@
|
|||
import GlobalMark from 'background/domains/global-mark';
|
||||
|
||||
describe("background/domains/global-mark", () => {
|
||||
describe("constructor and getter", () => {
|
||||
let mark = new GlobalMark(1, 10, 30);
|
||||
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);
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import MarkRepository from 'background/repositories/mark';
|
||||
import GlobalMark from 'background/domains/global-mark';
|
||||
|
||||
describe("background/repositories/version", () => {
|
||||
describe('background/repositories/mark', () => {
|
||||
let repository;
|
||||
|
||||
beforeEach(() => {
|
||||
|
@ -9,13 +9,16 @@ describe("background/repositories/version", () => {
|
|||
});
|
||||
|
||||
it('get and set', async() => {
|
||||
let mark = new GlobalMark(1, 10, 30);
|
||||
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;
|
||||
|
|
Reference in a new issue