Skip to content

Commit

Permalink
fix(test): change unit test to sync storage
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrusch committed Nov 29, 2020
1 parent b898df7 commit 41fcfed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/popup.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Popup Window', function () {
}
});
beforeEach(() => {
chrome.storage.local.get.yields({ pinned: ['about', 'history', 'crashes'] });
chrome.storage.sync.get.yields({ pinned: ['about', 'history', 'crashes'] });
sandbox.spy(Storage, 'save');
global.popup = new Popup();
});
Expand All @@ -51,16 +51,16 @@ describe('Popup Window', function () {
});

it('Menu Panel initializes without error', () => {
chrome.storage.local.get.yields({});
chrome.storage.sync.get.yields({});
expect(() => { new Popup() }, 'empty storage').to.not.throw();
chrome.storage.local.get.yields({ pinned: [] });
chrome.storage.sync.get.yields({ pinned: [] });
expect(() => { new Popup() }, 'no pinned items').to.not.throw();
chrome.storage.local.get.yields({ pinned: ['about', 'history'] });
chrome.storage.sync.get.yields({ pinned: ['about', 'history'] });
expect(() => { new Popup() }, 'some pinned items').to.not.throw();
});

it('Pin click toggles link on and off', () => {
chrome.storage.local.set.yields(null);
chrome.storage.sync.set.yields(null);
let link = getLink(0),
name = getLinkName(link),
pin = getLinkPin(link);
Expand Down

0 comments on commit 41fcfed

Please sign in to comment.