Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
lei9444 committed Nov 23, 2020
1 parent a83bdb1 commit a49daca
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Editor dispatcher', () => {
beforeEach(() => {
const useRecoilTestHook = () => {
const [visualEditorState, setVisualEditorState] = useRecoilState(visualEditorSelectionState);
const [clipboardState, setClipboardActionsState] = useRecoilState(clipboardActionsState);
const [clipboardState, setClipboardActionsState] = useRecoilState(clipboardActionsState('test'));
const currentDispatcher = useRecoilValue(dispatcherState);

return {
Expand All @@ -30,7 +30,7 @@ describe('Editor dispatcher', () => {
const { result } = renderRecoilHook(useRecoilTestHook, {
states: [
{ recoilState: visualEditorSelectionState, initialValue: [{ action1: 'initialVisualEditorValue' }] },
{ recoilState: clipboardActionsState, initialValue: [{ action1: 'initialClipboardVal' }] },
{ recoilState: clipboardActionsState('test'), initialValue: [{ action1: 'initialClipboardVal' }] },
],
dispatcher: {
recoilState: dispatcherState,
Expand All @@ -45,7 +45,7 @@ describe('Editor dispatcher', () => {

it('should set clipboard state correctly', () => {
act(() => {
dispatcher.setVisualEditorClipboard([{ action2: 'updatedVal' }]);
dispatcher.setVisualEditorClipboard([{ action2: 'updatedVal' }], 'test');
});
expect(renderedComponent.current.clipboardState).toEqual([{ action2: 'updatedVal' }]);
});
Expand Down

0 comments on commit a49daca

Please sign in to comment.