Skip to content

Commit

Permalink
test: cleanup #434
Browse files Browse the repository at this point in the history
  • Loading branch information
bsilkyn committed May 22, 2024
1 parent f18bd63 commit bac4c34
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 54 deletions.
23 changes: 8 additions & 15 deletions frontend/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,14 @@ const logout = () => {
});
}

before(() => {
cy.intercept('POST', '/api/auth/cas/logout/', (req) => {
console.log('intercepted');
req.headers['Referer'] = Cypress.config('baseUrl');

return req;
});

cy.request('POST', '/api/auth/test-user/student/');
logout();
cy.request('POST', '/api/auth/test-user/multi/');
logout();
cy.request('POST', '/api/auth/test-user/admin/');
logout();
})
// before(() => {
// cy.request('POST', '/api/auth/test-user/student/');
// logout();
// cy.request('POST', '/api/auth/test-user/multi/');
// logout();
// cy.request('POST', '/api/auth/test-user/admin/');
// logout();
// })

afterEach(() => {
logout();
Expand Down
10 changes: 8 additions & 2 deletions frontend/src/components/layout/base/BaseHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ const items = computed(() => [
<!-- Navigation -->
<div id="navigation" class="hidden md:flex w-full h-full">
<template v-if="isAuthenticated">
<RouterLink :to="{ name: item.route }" v-for="item in items" :key="item.route" class="nav-item">
<RouterLink
:to="{ name: item.route }"
v-for="item in items"
:key="item.route"
class="nav-item"
:id="item.route"
>
<div
class="flex align-items-center uppercase flex justify-content-center p-3 pl-0 cursor-pointer text-primary font-medium"
>
Expand Down Expand Up @@ -139,7 +145,7 @@ const items = computed(() => [
</div>
<div class="overflow-y-auto px-2">
<ul class="list-none p-0 m-0">
<li v-for="item in items" :key="item.route">
<li v-for="item in items" :key="item.route" :id="item.route">
<RouterLink
:to="{ name: item.route }"
@click="closeCallback"
Expand Down
15 changes: 0 additions & 15 deletions frontend/src/test/e2e/setup/data.ts

This file was deleted.

20 changes: 0 additions & 20 deletions frontend/src/test/e2e/setup/seed.ts

This file was deleted.

4 changes: 2 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ if [ "$frontend" = true ]; then
echo "Running frontend tests..."
echo "Filling up database with test data"
docker exec backend sh -c "python manage.py flush --no-input; python manage.py migrate; python manage.py loaddata
notifications/fixtures/$data/*; python manage.py loaddata authentication/fixtures/$data/*; python manage.py
loaddata api/fixtures/$data/*;"
notifications/fixtures/$data/*; python manage.py loaddata authentication/fixtures/$data/*; python
manage.py loaddata api/fixtures/$data/*;"
echo "Running Cypress tests..."
docker-compose -f test.yml up --exit-code-from cypress --abort-on-container-exit cypress
cypress_exit=$?
Expand Down

0 comments on commit bac4c34

Please sign in to comment.