Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
bencodeorg committed Jun 23, 2021
1 parent 1bf1aca commit 58f2226
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions apps/test/unit/javalab/JavalabEditorTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,20 @@ describe('Java Lab Editor Test', () => {
describe('componentDidUpdate', () => {
it('toggles between light and dark modes', () => {
const editor = createWrapper();
const javalabCodeMirrors = editor.find('JavalabEditor').instance()
.editors;
const javalabEditor = editor.find('JavalabEditor').instance();
const javalabCodeMirrors = javalabEditor.editors;
const firstEditor = Object.values(javalabCodeMirrors)[0];

const dispatchSpy = sinon.spy(firstEditor, 'dispatch');
store.dispatch(setIsDarkMode(true));
expect(dispatchSpy).to.have.been.calledWith({
reconfigure: {style: oneDark}
effects: javalabEditor.editorModeConfigCompartment.reconfigure(oneDark)
});
store.dispatch(setIsDarkMode(false));
expect(dispatchSpy).to.have.been.calledWith({
reconfigure: {style: lightMode}
effects: javalabEditor.editorModeConfigCompartment.reconfigure(
lightMode
)
});
});
});
Expand Down

0 comments on commit 58f2226

Please sign in to comment.