Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page-404: #199

Merged
merged 35 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ccb2b62
rewrited prewious branch page-404:
krovostcora Apr 25, 2024
d72cb42
Merge branch 'master' into page404
krovostcora Apr 25, 2024
635e57c
changed index.test.js
krovostcora Apr 25, 2024
8a0eb21
removed unused properties
krovostcora Apr 25, 2024
b0b0521
Merge branch 'master' into page404
krovostcora Apr 25, 2024
e10644f
removed Protected Routs from Profile
krovostcora Apr 25, 2024
356a114
changed App.js
krovostcora Apr 25, 2024
fab6f84
Merge branch 'master' into page404
didierrc Apr 25, 2024
d726c5a
added waiting time in utils.js
krovostcora Apr 26, 2024
2e2166e
trying to fix e2e test error
krovostcora Apr 27, 2024
8b70925
trying to fix e2e test error
krovostcora Apr 27, 2024
917537c
trying to fix e2e test error
krovostcora Apr 27, 2024
b25351e
trying to fix e2e test error
krovostcora Apr 27, 2024
71374b9
trying to fix e2e test error
krovostcora Apr 27, 2024
c6aea32
trying to fix e2e test error
krovostcora Apr 27, 2024
787f610
trying to fix e2e test error
krovostcora Apr 27, 2024
76472cc
trying to fix e2e test error
krovostcora Apr 27, 2024
fa0838a
trying to fix e2e test error
krovostcora Apr 27, 2024
9a41d3f
trying to fix e2e test error
krovostcora Apr 27, 2024
aa3b65e
trying to fix e2e test error
krovostcora Apr 27, 2024
423a110
trying to fix e2e test error
krovostcora Apr 27, 2024
fd61796
trying to fix e2e test error
krovostcora Apr 27, 2024
befe5fd
trying to fix e2e test error
krovostcora Apr 27, 2024
4e7e69b
trying to fix e2e test error
krovostcora Apr 27, 2024
cb3cca9
trying to fix e2e test error
krovostcora Apr 27, 2024
27b412d
trying to fix e2e test error
krovostcora Apr 27, 2024
42efa65
trying to fix e2e test error
krovostcora Apr 27, 2024
9b40c61
trying to fix e2e test error
krovostcora Apr 27, 2024
77a1be1
trying to fix e2e test error
krovostcora Apr 27, 2024
0462848
removed .idea
krovostcora Apr 27, 2024
d2786c4
added tests for PageNotFound.js
krovostcora Apr 28, 2024
705826e
added tests for PageNotFound.js
krovostcora Apr 28, 2024
7f6f142
Fixed translations and css
carlosmndzg Apr 28, 2024
23eeb8d
Merge branch 'page404' of https://github.com/Arquisoft/wiq_en3b into …
didierrc Apr 28, 2024
39e0524
Added changes to test
didierrc Apr 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/wiq_en3b.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions webapp/e2e/steps/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
async function selectNavOptionByHref(page, hrefValue) {
await page.click('div.header-button')
await page.click(`a.nav-link[href="${hrefValue}"]`)
await page.click('div.close-button')
await page.click('div.header-button');
await page.waitForSelector(`a.nav-link[href="${hrefValue}"]`, { visible: true });
await page.click(`a.nav-link[href="${hrefValue}"]`);
await page.click('div.close-button');
}


module.exports = { selectNavOptionByHref }
95 changes: 79 additions & 16 deletions webapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
"i18next": "^23.10.1",
"i18next-browser-languagedetector": "^7.2.0",
"i18next-http-backend": "^2.5.0",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-countdown": "^2.3.2",
"react-dom": "^18.2.0",
"react-i18next": "^14.1.0",
"react-lottie": "^1.2.4",
"react-password-strength-bar": "^0.4.1",
"react-router-dom": "^6.3.0",
"react-router-dom": "^6.23.0",
"react-scripts": "5.0.1",
"web-vitals": "^3.5.1"
},
Expand Down Expand Up @@ -54,6 +56,7 @@
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"axios-mock-adapter": "^1.22.0",
"cross-env": "^7.0.3",
"expect-puppeteer": "^9.0.2",
Expand Down
71 changes: 38 additions & 33 deletions webapp/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Settings from './pages/Settings/Settings'
import Login from './pages/Login/Login'
import Logout from './pages/Logout/Logout'
import Register from './pages/Register/Register'
import PageNotFound from "./pages/PageNotFound/PageNotFound";

import { ProtectedRoute } from './components/ProtectedRoute'

Expand All @@ -19,39 +20,43 @@ import { useState } from 'react'

function App() {

//State for the volume
const [volume, setVolume] = useState(10);

const handleVolumeChange = (event, newVolume) => {
setVolume(newVolume);
};

return (
<SettingsProvider>
<AuthProvider>
<Routes>
<Route element={<AppLayout volume={volume} />}>
<Route path="/" index element={<Home />}></Route>
<Route path="/login" element={<Login />}></Route>
<Route path="/register" element={<Register />}></Route>
<Route path="/logout" element={<Logout />} />
<Route
path="game"
element={
<ProtectedRoute>
<Game />
</ProtectedRoute>
}
></Route>
<Route path="profile/:username?" element={<Profile />} />
<Route path="leaderboard" element={<Leaderboard />}></Route>
<Route path="settings" element={<Settings volume={volume} handleVolumeChange={handleVolumeChange} />}></Route>
</Route>
</Routes>
</AuthProvider>
</SettingsProvider>
)
//State for the volume
const [volume, setVolume] = useState(10);

const handleVolumeChange = (event, newVolume) => {
setVolume(newVolume);
};

return (
<SettingsProvider>
<AuthProvider>
<Routes>
<Route element={<AppLayout volume={volume} />}>
<Route path="/" index element={<Home />}></Route>
<Route path="/login" element={<Login />}></Route>
<Route path="/register" element={<Register />}></Route>
<Route path="/logout" element={<Logout />} />
<Route
path="game"
element={
<ProtectedRoute>
<Game />
</ProtectedRoute>
}
></Route>
<Route path="profile/:username?" element={<Profile />} />
<Route path="leaderboard" element={<Leaderboard />}></Route>
<Route path="settings" element={<Settings volume={volume} handleVolumeChange={handleVolumeChange} />}></Route>
</Route>
<Route
path="*"
element={<PageNotFound />}
/>
</Routes>
</AuthProvider>
</SettingsProvider>
)

}

export default App
export default App
26 changes: 18 additions & 8 deletions webapp/src/components/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,25 @@ import { render } from '@testing-library/react'
import App from '../../App'
import { runI18n } from './utils/i18n.test-utils'

jest.mock('react-lottie', () => ({
__esModule: true,
default: () => <div>Lottie</div>,
}));


it('renders without crashing', () => {
runI18n()
const root = document.createElement('div')
document.body.appendChild(root)

render(
<BrowserRouter>
<App />
</BrowserRouter>,
root
)
if (typeof document !== 'undefined') {
const root = document.createElement('div')
document.body.appendChild(root)

render(
<BrowserRouter>
<App />
</BrowserRouter>,
root
)
}
})

1 change: 1 addition & 0 deletions webapp/src/lotties/asleep_cat.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webapp/src/lotties/sleeping_cat.json

Large diffs are not rendered by default.

Loading
Loading