Skip to content

Commit

Permalink
add setOptions test
Browse files Browse the repository at this point in the history
  • Loading branch information
hogashi committed Jan 8, 2023
1 parent fa98317 commit b627845
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion __tests__/options.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
MIGRATED_TO_CHROME_STORAGE,
SHOW_ON_TWEETDECK_TIMELINE,
SHOW_ON_TIMELINE,
SHOW_ON_TWEETDECK_TWEET_DETAIL,
} from '../src/constants';

import { getOptions, setOptions } from '../src/extension-contexts/options';
Expand Down Expand Up @@ -64,6 +65,9 @@ describe('options', () => {
});
});
describe('setOptions', () => {
// TODO
const expected = { ...initialOptionsBool, [SHOW_ON_TWEETDECK_TWEET_DETAIL]: false };
setOptions(expected);
expect(chrome.storage.sync.set.mock.calls.length).toBe(1);
expect(chrome.storage.sync.set.mock.lastCall[0]).toBe(expected);
});
});

0 comments on commit b627845

Please sign in to comment.