mirror of
https://github.com/UniversityOfHelsinkiCS/ohtuilmo.git
synced 2026-10-12 19:03:41 +03:00
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:
@@ -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
@@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user