Fix plugin store API tests

This commit is contained in:
Gregory Schier 2018-06-27 01:21:11 -04:00
parent 74d28790ab
commit 6126dce3c5

View File

@ -13,6 +13,7 @@ describe('init()', () => {
it('initializes correctly', async () => {
const result = plugin.init({ name: PLUGIN });
expect(Object.keys(result.store).sort()).toEqual([
'clear',
'getItem',
'hasItem',
'removeItem',
@ -38,5 +39,14 @@ describe('store.*', () => {
await p.store.removeItem('color');
expect(await p.store.hasItem('color')).toBe(false);
expect(await p.store.getItem('color')).toBeNull();
// Clear it
await p.store.setItem('a', 'a');
await p.store.setItem('b', 'b');
await p.store.setItem('c', 'c');
await p.store.clear();
expect(await p.store.getItem('a')).toBeNull();
expect(await p.store.getItem('b')).toBeNull();
expect(await p.store.getItem('c')).toBeNull();
});
});