{result.map((item, index) => {
- const resut = !_.isString(item) ? JSON.stringify(item) : item;
+ const consoleItem = !_.isString(item) ? JSON.stringify(item) : item;
return (
›
- {resut}
+
+ {consoleItem}
+
);
diff --git a/src/components/ContextMenu/ContextMenu.spec.tsx b/src/components/ContextMenu/ContextMenu.spec.tsx
index 1d270cf..06f1e4e 100644
--- a/src/components/ContextMenu/ContextMenu.spec.tsx
+++ b/src/components/ContextMenu/ContextMenu.spec.tsx
@@ -7,7 +7,7 @@ describe('
', () => {
onClick: jest.fn(),
onClose: jest.fn(),
};
- it('does not render if poistion is not defined', () => {
+ it('does not render if position is not defined', () => {
render(
);
expect(screen.queryByTestId('app-context-menu')).not.toBeInTheDocument();
});
diff --git a/src/components/Header/Header.spec.tsx b/src/components/Header/Header.spec.tsx
index 98e096d..a61c6b0 100644
--- a/src/components/Header/Header.spec.tsx
+++ b/src/components/Header/Header.spec.tsx
@@ -1,19 +1,18 @@
import { cleanup, fireEvent, render, screen } from '@testing-library/react';
import Header from 'components/Header';
import { AppContext } from 'context/AppContext';
-import { AppAactions } from 'context/Reducer';
+import { AppActions } from 'context/Reducer';
describe('
', () => {
describe('header actions', () => {
const state = { codeSample: '', codeSampleName: '' } as AppState;
- let dispatch: any;
+ let dispatch: jest.Mock;
beforeEach(() => {
dispatch = jest.fn();
render(
- // eslint-disable-next-line react/jsx-no-constructed-context-values
-
+ ,
);
});
@@ -25,28 +24,28 @@ describe('
', () => {
fireEvent.click(screen.getByText('About'));
expect(dispatch).toHaveBeenCalledWith({
payload: 'block',
- type: AppAactions.TOGGLE_ABOUT_MODAL,
+ type: AppActions.TOGGLE_ABOUT_MODAL,
});
});
it('toggle the theme when toggle button is click', () => {
fireEvent.click(screen.getByTestId('app-theme-button-vs-dark'));
expect(dispatch).toHaveBeenCalledWith({
payload: 'vs-dark',
- type: AppAactions.TOGGLE_THEME,
+ type: AppActions.TOGGLE_THEME,
});
});
it('dispatch execute code action when run button is clicked', () => {
fireEvent.click(screen.getByTestId('actionbutton-button-execute'));
expect(dispatch).toHaveBeenCalledWith({
- type: AppAactions.CODE_RUNNING,
+ type: AppActions.CODE_RUNNING,
});
});
it('dispatch clear result action when clear button is clicked', () => {
fireEvent.click(screen.getByTestId('actionbutton-button-clear'));
expect(dispatch).toHaveBeenCalledWith({
- type: AppAactions.CLEAR_RESULT,
+ type: AppActions.CLEAR_RESULT,
});
});
@@ -55,7 +54,7 @@ describe('
', () => {
target: { value: 'Axios' },
});
expect(dispatch).toHaveBeenCalledWith({
- type: AppAactions.LOAD_CODE_SAMPLE,
+ type: AppActions.LOAD_CODE_SAMPLE,
payload: expect.objectContaining({
codeSampleName: 'Axios',
}),
diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx
index 359e716..10e64ba 100644
--- a/src/components/Header/Header.tsx
+++ b/src/components/Header/Header.tsx
@@ -1,7 +1,7 @@
import { ChangeEvent, useContext } from 'react';
import ActionButton from 'components/ActionButton';
import { AppContext } from 'context/AppContext';
-import { AppAactions } from 'context/Reducer';
+import { AppActions } from 'context/Reducer';
import { CODE_SAMPLES, EDITOR_THEMES } from 'helpers/const';
import useCodeRunner from 'hooks/useCodeRunner';
@@ -22,7 +22,7 @@ const Header: React.FC = () => {
codeSampleName: value,
};
- dispatch({ type: AppAactions.LOAD_CODE_SAMPLE, payload });
+ dispatch({ type: AppActions.LOAD_CODE_SAMPLE, payload });
};
return (
@@ -40,7 +40,7 @@ const Header: React.FC = () => {
style={{ cursor: 'pointer' }}
onClick={() =>
dispatch({
- type: AppAactions.TOGGLE_ABOUT_MODAL,
+ type: AppActions.TOGGLE_ABOUT_MODAL,
payload: 'block',
})
}
@@ -72,7 +72,6 @@ const Header: React.FC = () => {
{EDITOR_THEMES.map(item => (
- // eslint-disable-next-line jsx-a11y/control-has-associated-label