Merge pull request #178 from Ohtuilmo/fix/revert-app-try-catch-block

Revert App.js try-catch block as it was breaking tests
This commit is contained in:
Mikko Ahro
2024-03-11 15:08:58 +02:00
committed by GitHub
2 changed files with 4 additions and 10 deletions
+1
View File
@@ -29,6 +29,7 @@
"build": "react-scripts build", "build": "react-scripts build",
"eject": "react-scripts eject", "eject": "react-scripts eject",
"test": "CYPRESS_baseUrl=http://localhost:3000 npm run cypress:open", "test": "CYPRESS_baseUrl=http://localhost:3000 npm run cypress:open",
"test:headless": "CYPRESS_baseUrl=http://localhost:3000 npm run cypress:run",
"lint": "eslint src/", "lint": "eslint src/",
"e2e:install": "./e2e/run_cypress_e2e.sh install", "e2e:install": "./e2e/run_cypress_e2e.sh install",
"e2e:setup": "./e2e/run_cypress_e2e.sh setup", "e2e:setup": "./e2e/run_cypress_e2e.sh setup",
+3 -10
View File
@@ -80,11 +80,7 @@ const App = (props) => {
useEffect(() => { useEffect(() => {
const handleLogin = async () => { const handleLogin = async () => {
if (!window.location.href.includes('customer-review/')) { if (!window.location.href.includes('customer-review/')) {
try { await loginUser()
await loginUser()
} catch (err) {
console.log(err)
}
} }
} }
@@ -97,13 +93,10 @@ const App = (props) => {
} }
fetchData() fetchData()
const loginInterval = setInterval(() => { const loginInterval = setInterval(() => {
if (!window.location.href.includes('customer-review/')) { if (!window.location.href.includes('customer-review/')) {
try { loginService.login()
loginService.login()
} catch (err) {
console.log(err)
}
} }
}, 60 * 1000) }, 60 * 1000)