Skip to content

Commit

Permalink
split component
Browse files Browse the repository at this point in the history
  • Loading branch information
hogashi committed May 21, 2022
1 parent af27f3b commit 3b0511b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 202 deletions.
16 changes: 8 additions & 8 deletions __tests__/popup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ import {
isTrue,
OPTION_KEYS,
} from '../src/main';
import { Popup } from '../src/popup';
import { Popup } from '../src/components/Popup';

describe('Popup', () => {
it('render', () => {
const optionsText = OPTIONS_TEXT;
const optionKeys = OPTION_KEYS;
const optionsEnabled = {};
const options = {};
optionKeys.forEach(key => {
optionsEnabled[key] = true;
options[key] = isTrue;
});

const props = {
optionsText,
optionKeys,
optionsEnabled,
options,
};
const tree = TestRenderer.create(<Popup {...props} />).toJSON();
expect(tree).toMatchSnapshot();
Expand All @@ -40,20 +40,20 @@ describe('Popup', () => {

const optionsText = OPTIONS_TEXT;
const optionKeys = OPTION_KEYS;
const optionsEnabled = {};
const options = {};
const expectOptions = {};
optionKeys.forEach(key => {
optionsEnabled[key] = true;
options[key] = isTrue;
expectOptions[key] = isTrue;
});
// 初期設定いっこOFFにしてみる
optionsEnabled[SHOW_ON_TIMELINE] = false;
options[SHOW_ON_TIMELINE] = isFalse;
expectOptions[SHOW_ON_TIMELINE] = isFalse;

const props = {
optionsText,
optionKeys,
optionsEnabled,
options,
};

window.chrome = {
Expand Down
194 changes: 0 additions & 194 deletions src/popup.tsx

This file was deleted.

0 comments on commit 3b0511b

Please sign in to comment.