Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelfangjw committed Jun 16, 2021
1 parent bc154f2 commit 12401bc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/pages/sicp/__tests__/Sicp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ describe('Sicp renders', () => {
</Provider>
);
const wrapper = mount(sicp);
const display = wrapper.find('.sicp-content');
expect(display.prop('children')).toEqual(<SicpIndexPage />);
expect(wrapper.contains(<SicpIndexPage />)).toBeTruthy();
});
});
5 changes: 1 addition & 4 deletions src/pages/sicp/subcomponents/CodeSnippet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { HighlightRulesSelector, ModeSelector } from 'js-slang/dist/editors/ace/
import { Resizable } from 're-resizable';
import * as React from 'react';
import { useMediaQuery } from 'react-responsive';
import js from 'react-syntax-highlighter/dist/esm/languages/prism/javascript';
import SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light';
import { PrismLight as SyntaxHighlighter } from 'react-syntax-highlighter';
import ControlBar from 'src/commons/controlBar/ControlBar';
import { ControlBarCloseButton } from 'src/commons/controlBar/ControlBarCloseButton';
import { ControlBarShowDependenciesButton } from 'src/commons/controlBar/ControlBarShowDependenciesButton';
Expand Down Expand Up @@ -49,8 +48,6 @@ const CodeSnippet: React.FC<CodeSnippetProps> = props => {
const [showPrepend, setShowPrepend] = React.useState(false);
const isMobileBreakpoint = useMediaQuery({ maxWidth: Constants.mobileBreakpoint });

SyntaxHighlighter.registerLanguage('javascript', js);

const handleShowDependencies = React.useCallback(() => {
setShowPrepend(!showPrepend);
}, [showPrepend]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

exports[`Sicp Code Snippet renders correctly 1`] = `
"<div className=\\"sicp-code-snippet\\">
<ReactAsyncHighlighter language=\\"javascript\\" style={{...}} onClick={[Function: handleOpen]}>
<SyntaxHighlighter language=\\"javascript\\" style={{...}} onClick={[Function: handleOpen]}>
1+1;
</ReactAsyncHighlighter>
</SyntaxHighlighter>
<Component>
2
</Component>
Expand Down

0 comments on commit 12401bc

Please sign in to comment.