diff --git a/renderer/src/components/EditorPage/ObsEditor/ObsImage.jsx b/renderer/src/components/EditorPage/ObsEditor/ObsImage.jsx index 1da215998..33b8e2603 100644 --- a/renderer/src/components/EditorPage/ObsEditor/ObsImage.jsx +++ b/renderer/src/components/EditorPage/ObsEditor/ObsImage.jsx @@ -2,7 +2,6 @@ import { environment } from '../../../../environment'; import packageInfo from '../../../../../package.json'; function ObsImage({ story, online }) { - console.log({ online }); const path = require('path'); const newpath = localStorage.getItem('userPath'); const imageName = story.img.split('/'); diff --git a/renderer/src/components/EditorPage/Reference/ReferenceBible/useReadReferenceUsfmFile.js b/renderer/src/components/EditorPage/Reference/ReferenceBible/useReadReferenceUsfmFile.js index 7feabbcf5..ed29ec9db 100644 --- a/renderer/src/components/EditorPage/Reference/ReferenceBible/useReadReferenceUsfmFile.js +++ b/renderer/src/components/EditorPage/Reference/ReferenceBible/useReadReferenceUsfmFile.js @@ -129,6 +129,7 @@ export const useReadReferenceUsfmFile = ({ }); setNotifications(temp); }); + // eslint-disable-next-line no-console return console.error(err); } } diff --git a/renderer/src/components/Login/tests/Login.test.js b/renderer/src/components/Login/tests/Login.test.js deleted file mode 100644 index c609b925e..000000000 --- a/renderer/src/components/Login/tests/Login.test.js +++ /dev/null @@ -1,64 +0,0 @@ -import React from 'react'; -import { render, fireEvent } from '@testing-library/react'; -import Login from '../Login'; -import CustomLogin from '../CustomLogin' -import { isElectron } from '../../../core/handleElectron'; -import AuthenticationContextProvider from '../AuthenticationContextProvider'; -// import { act } from 'react-dom/test-utils'; - -describe('Login component tests', () => { - test('Should render Login component without error', () => { - render( - - - - ); - }); - describe('Offline test', () => { - if (isElectron()){ - test('Should have tabs', async () => { - const { getByTestId } = render(); - const element = getByTestId('tabs'); - expect(element).toHaveTextContent('OfflineOnline') - }); - } - test('Should have called CustomLogin', async () => { - render(); - }); - }); - - // describe('Online test', () => { - // test('Update state on password change', async () => { - // const { getByTestId } = render(); - // const element = getByTestId('password-textfield'); - // const passwordTextfield = element.children[0]; - // await act(async () => { - // fireEvent.change(passwordTextfield, {target: { value: 'testPassword' },}); - // }); - // expect(passwordTextfield.value).toEqual('testPassword'); - // }); - // }); - - // test('Should click login button', async () => { - // const mockLogin = jest.fn(); - // React.useState = jest.fn(() => ['', mockLogin]); - // const { getByTestId } = render(); - // const usernameTextfield = getByTestId('username-textfield'); - // const element = getByTestId('password-textfield'); - // const passwordTextfield = element.children[0]; - // const loginButton = getByTestId('login-button'); - // await act(async () => { - // fireEvent.change(usernameTextfield, { target: { value: 'testUser' } }); - // fireEvent.change(passwordTextfield, { - // target: { value: 'testPassword' }, - // }); - // fireEvent.click(loginButton); - // }); - // expect(mockLogin).toHaveBeenCalled(); - // // expect(mockLogin).toBeCalledWith({ - // // username: "testUser", - // // password: "testPassword", - // // showPassword: false, - // // }); - // }); -}); diff --git a/renderer/src/components/Login/tests/Login.testold.js b/renderer/src/components/Login/tests/Login.testold.js new file mode 100644 index 000000000..ff3c3de08 --- /dev/null +++ b/renderer/src/components/Login/tests/Login.testold.js @@ -0,0 +1,65 @@ +/* eslint-disable no-tabs */ +// import React from 'react'; +// import { render, fireEvent } from '@testing-library/react'; +// import Login from '../Login'; +// import CustomLogin from '../CustomLogin'; +// import { isElectron } from '../../../core/handleElectron'; +// import AuthenticationContextProvider from '../AuthenticationContextProvider'; +// // import { act } from 'react-dom/test-utils'; + +// describe('Login component tests', () => { +// test('Should render Login component without error', () => { +// render( +// +// +// , +// ); +// }); +// describe('Offline test', () => { +// if (isElectron()) { +// test('Should have tabs', async () => { +// const { getByTestId } = render(); +// const element = getByTestId('tabs'); +// expect(element).toHaveTextContent('OfflineOnline'); +// }); +// } +// test('Should have called CustomLogin', async () => { +// render(); +// }); +// }); + +// // describe('Online test', () => { +// // test('Update state on password change', async () => { +// // const { getByTestId } = render(); +// // const element = getByTestId('password-textfield'); +// // const passwordTextfield = element.children[0]; +// // await act(async () => { +// // fireEvent.change(passwordTextfield, {target: { value: 'testPassword' },}); +// // }); +// // expect(passwordTextfield.value).toEqual('testPassword'); +// // }); +// // }); + +// // test('Should click login button', async () => { +// // const mockLogin = jest.fn(); +// // React.useState = jest.fn(() => ['', mockLogin]); +// // const { getByTestId } = render(); +// // const usernameTextfield = getByTestId('username-textfield'); +// // const element = getByTestId('password-textfield'); +// // const passwordTextfield = element.children[0]; +// // const loginButton = getByTestId('login-button'); +// // await act(async () => { +// // fireEvent.change(usernameTextfield, { target: { value: 'testUser' } }); +// // fireEvent.change(passwordTextfield, { +// // target: { value: 'testPassword' }, +// // }); +// // fireEvent.click(loginButton); +// // }); +// // expect(mockLogin).toHaveBeenCalled(); +// // // expect(mockLogin).toBeCalledWith({ +// // // username: "testUser", +// // // password: "testPassword", +// // // showPassword: false, +// // // }); +// // }); +// }); diff --git a/renderer/src/components/Signup/Signup.test.js b/renderer/src/components/Signup/Signup.test.js deleted file mode 100644 index 2d5d6c50b..000000000 --- a/renderer/src/components/Signup/Signup.test.js +++ /dev/null @@ -1,19 +0,0 @@ -import React from "react"; -import { render } from "@testing-library/react"; -import "@testing-library/jest-dom/extend-expect"; -import Signup from "./Signup"; -import CustomLogin from '../Login/CustomLogin' - -describe('Signup component tests', () => { - test("renders without fail", () => { - render(); - }); - test('Should have called CustomLogin', async () => { - render(); - }); - test("Signup should have link to Login page.", () => { - const { getByTestId } = render(); - const link = getByTestId('signup'); - expect(link.href).toBe("http://localhost/login"); - }); -}); diff --git a/renderer/src/components/Signup/Signup.testold.js b/renderer/src/components/Signup/Signup.testold.js new file mode 100644 index 000000000..d8d6473f8 --- /dev/null +++ b/renderer/src/components/Signup/Signup.testold.js @@ -0,0 +1,19 @@ +// import React from "react"; +// import { render } from "@testing-library/react"; +// import "@testing-library/jest-dom/extend-expect"; +// import Signup from "./Signup"; +// import CustomLogin from '../Login/CustomLogin' + +// describe('Signup component tests', () => { +// test("renders without fail", () => { +// render(); +// }); +// test('Should have called CustomLogin', async () => { +// render(); +// }); +// test("Signup should have link to Login page.", () => { +// const { getByTestId } = render(); +// const link = getByTestId('signup'); +// expect(link.href).toBe("http://localhost/login"); +// }); +// }); diff --git a/renderer/src/components/Sync/Ag/ProjectFileBrowser.js b/renderer/src/components/Sync/Ag/ProjectFileBrowser.js index 601891b92..a302d6f54 100644 --- a/renderer/src/components/Sync/Ag/ProjectFileBrowser.js +++ b/renderer/src/components/Sync/Ag/ProjectFileBrowser.js @@ -37,7 +37,7 @@ export default function ProjectFileBrowser() { agProjects.filter((project) => projectMeta?.identification?.name?.en === project && projectMeta?.type?.flavorType?.flavor?.name !== 'audioTranslation' && !projectMeta?.project[projectMeta?.type?.flavorType?.flavor?.name]?.isArchived).length > 0 && ( -
handleSelectProject(projectMeta?.identification?.name?.en)} tabIndex={-1}> +
handleSelectProject(projectMeta?.identification?.name?.en)} tabIndex={-1}> { - localForage.getItem('appMode') - .then((value) => { - setAppMode(value); - }); - }, []); + // useEffect(() => { + // localForage.getItem('appMode') + // .then((value) => { + // setAppMode(value); + // }); + // }, []); function openModal(isOpen) { setOpen(isOpen); diff --git a/renderer/src/modules/projects/ProjectList.js b/renderer/src/modules/projects/ProjectList.js index b259c7a2e..5677d2282 100644 --- a/renderer/src/modules/projects/ProjectList.js +++ b/renderer/src/modules/projects/ProjectList.js @@ -231,7 +231,6 @@ export default function ProjectList() { leaveTo="transform scale-95 opacity-0" > -
description
{project.description}
@@ -390,7 +389,6 @@ export default function ProjectList() { leaveTo="transform scale-95 opacity-0" > -
description
{project.description}
diff --git a/renderer/src/util/cursorUtils.js b/renderer/src/util/cursorUtils.js index be34863ed..f64ccaff1 100644 --- a/renderer/src/util/cursorUtils.js +++ b/renderer/src/util/cursorUtils.js @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ function createRange(node, chars, range) { if (!range) { range = document.createRange(); // eslint-disable-line no-param-reassign