Skip to content

Commit

Permalink
fix: e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibault-Brocheton committed Jul 28, 2023
1 parent c6195d1 commit 09c98f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
15 changes: 8 additions & 7 deletions e2e/cypress/common/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ export const loginWithFakeOAuth2 = () => {
expect(params.get('client_id')).to.eq('dummy_client_id');
expect(params.get('response_type')).to.eq('code');
expect(params.get('scope')).to.eq('openid email profile');
});
expect(params.get('state')).to.matches(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i); // should be the uuid generated by crypto

Check failure on line 37 in e2e/cypress/common/login.ts

View workflow job for this annotation

GitHub Actions / E2E Static Check 🪲

Replace `/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i` with `⏎······/^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i⏎····`

cy.contains('Fake OAuht2').should('be.visible');
cy.visit(
HOST +
'/login/auth_callback/oauth2?code=this_is_dummy_code&redirect_uri=https%3A%2F%2Fdummy-url.com%2Fcallback'
);
cy.contains('Projects').should('be.visible');
cy.contains('Fake OAuht2').should('be.visible');
cy.visit(
HOST +
`/login/auth_callback/oauth2?code=this_is_dummy_code&redirect_uri=https%3A%2F%2Fdummy-url.com%2Fcallback&state=${params.get('state')}`

Check failure on line 42 in e2e/cypress/common/login.ts

View workflow job for this annotation

GitHub Actions / E2E Static Check 🪲

Replace ``/login/auth_callback/oauth2?code=this_is_dummy_code&redirect_uri=https%3A%2F%2Fdummy-url.com%2Fcallback&state=${params.get('state'` with `··`/login/auth_callback/oauth2?code=this_is_dummy_code&redirect_uri=https%3A%2F%2Fdummy-url.com%2Fcallback&state=${params.get(⏎··········'state'⏎········`
);
cy.contains('Projects').should('be.visible');
});
};

export const loginViaForm = (username = USERNAME, password = PASSWORD) => {
Expand Down
1 change: 0 additions & 1 deletion webapp/src/service/AnonymousIdService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export const AnonymousIdService = {
reset() {
return localStorage.setItem(
ANONYMOUS_ID_LOCAL_STORAGE_KEY,
// @ts-ignore
crypto.randomUUID()
);
},
Expand Down

0 comments on commit 09c98f0

Please sign in to comment.