Skip to content

Commit

Permalink
correction on path permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulEntourage committed Dec 5, 2023
1 parent 0506dbf commit 78f1189
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
30 changes: 18 additions & 12 deletions cypress/e2e/candidat.cy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-undef */
describe('Candidat', () => {
beforeEach(() => {
cy.intercept('GET', '/cv/shares', { total: 184222 }).as('cvShares');
cy.intercept('GET', '/cv/shares', { total: 184221 }).as('cvShares');

cy.intercept('GET', '/auth/current', {
fixture: 'auth-current-candidat-res',
Expand Down Expand Up @@ -78,15 +78,18 @@ describe('Candidat', () => {
cy.intercept('PUT', '/user/changePwd', {}).as('changePwd');
});
it('should open backoffice public offers', () => {
cy.visit('/backoffice/candidat/offres/public', {
onBeforeLoad: function async(window) {
window.localStorage.setItem('access-token', '1234');
window.localStorage.setItem('release-version', 'v100');
},
cy.fixture('auth-current-candidat-res').then((user) => {
cy.visit(`/backoffice/candidat/offres/public`, {
onBeforeLoad: function async(window) {
window.localStorage.setItem('access-token', '1234');
window.localStorage.setItem('release-version', 'v100');
},
});
cy.url().should('include', user.id);
});

// check if list is complete
cy.get('[data-testid="candidat-offer-list-container"]')
cy.get('[data-testid="candidat-offer-list-container"]', { timeout: 20000 })
.find('> div')
.should('have.length', 16);

Expand Down Expand Up @@ -115,11 +118,14 @@ describe('Candidat', () => {
});

it('should open backoffice private offers and add new opportunity', () => {
cy.visit('/backoffice/candidat/offres/private', {
onBeforeLoad: function async(window) {
window.localStorage.setItem('access-token', '1234');
window.localStorage.setItem('release-version', 'v100');
},
cy.fixture('auth-current-candidat-res').then((user) => {
cy.visit(`/backoffice/candidat/offres/private`, {
onBeforeLoad: function async(window) {
window.localStorage.setItem('access-token', '1234');
window.localStorage.setItem('release-version', 'v100');
},
});
cy.url().should('include', user.id);
});
// check if the right opportunity is open
cy.fixture('user-opportunity-all-res').then((offersList) => {
Expand Down
1 change: 1 addition & 0 deletions src/hooks/authentication/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const authenticatedPermissions = [
paths: [
'/backoffice/candidat/cv',
'/backoffice/candidat/[candidateId]/offres',
'/backoffice/candidat/offres',
'/backoffice/candidat/[candidateId]/suivi',
'/backoffice/candidat/[candidateId]/cv',
],
Expand Down

0 comments on commit 78f1189

Please sign in to comment.