generated from SocialGouv/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ajout de nouveau test , maj packages, bug session aborted résolu (
#22) * feat: ajout de nouveau test pour le composant Ajout-Demande sur cypress, déplacement du dossier page dans src/, mise a jour du package react-dsfr + cypress * fix(package): remove unused package * fix: enlever les tests de ajout-demande temporairement * fix: fix script to run cypress with correct config file * fix downgrade cypress packages * fix: remove frozen-lockfile in workflows * conflict: resolve conflict with master * add 1000jours logo, fix import css --------- Co-authored-by: MinaBarry <[email protected]>
- Loading branch information
1 parent
c7afbaa
commit cffc155
Showing
38 changed files
with
1,502 additions
and
1,468 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"baseUrl": "http://localhost:3000" | ||
} | ||
"baseUrl": "http://localhost:3000" | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
describe("Formulaire d'ajout page", () => { | ||
it("should be correct input label", () => { | ||
cy.visit('/ajout-demande') | ||
}) | ||
|
||
//TODO Ajouter la logique de login pour permettre aux tests d'accéder aux composant | ||
// beforeEach(() => { | ||
// cy.visit("/ajout-demande"); | ||
// }); | ||
// it("should be correct input label", () => { | ||
// cy.get("form > :nth-child(1) > .fr-label").should("contain", "Prénom"); | ||
// cy.get("form > :nth-child(2) > .fr-label").should("contain", "Nombre d'enfants"); | ||
// cy.get("form > :nth-child(3) > .fr-label").should("contain", "Date de naissance du dernier enfant"); | ||
// cy.get("form > :nth-child(4) > .fr-label").should("contain", "Département"); | ||
// cy.get("form > :nth-child(5) > .fr-label").should("contain", "Date de prise de contact"); | ||
// cy.get("form > :nth-child(6) > .fr-label").should("contain", "Provenance du contact"); | ||
// }); | ||
// it("allows users to subscribe to the email list", () => { | ||
// cy.get("#name").type("Mina") | ||
// cy.get("#childNumber").type("2") | ||
// cy.get('#select-\\:r8\\:').select("01 - Ain") | ||
// }) | ||
// it("should write a comment", () => { | ||
// cy.get("#comment").type("Ceci est un long message de test pour tester mon composant\nLe retour a la ligne se fait il correctement ?") | ||
// }) | ||
// it("should click on button", () => { | ||
// cy.get("form > .fr-btn").click() | ||
// }) | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<title>Components App</title> | ||
<!-- Used by Next.js to inject CSS. --> | ||
<div id="__next_css__DO_NOT_USE__"></div> | ||
</head> | ||
<body> | ||
<div data-cy-root></div> | ||
</body> | ||
</html> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
18 changes: 9 additions & 9 deletions
18
src/utils/main.util.test.ts → src/__test__/main.util.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import NextAuth from 'next-auth' | ||
import CredentialsProvider from 'next-auth/providers/credentials' | ||
import axios from 'axios' | ||
import { StrapiUser } from '../../../types/StrapiType'; | ||
import { StrapiUser } from '../../../../types/StrapiType'; | ||
|
||
export default NextAuth({ | ||
providers: [ | ||
CredentialsProvider({ | ||
name: 'Credentials', | ||
credentials: { | ||
email: { label: "Email", type: "text", placeholder: "[email protected]" }, | ||
password: { label: "Password", type: "password" } | ||
password: { label: "Password", type: "password" } | ||
}, | ||
async authorize(credentials) { | ||
async authorize(credentials) { | ||
try { | ||
const { data } = await axios.post(`${process.env.NEXT_PUBLIC_API_URL}/auth/local`, { | ||
identifier: credentials?.email, | ||
|
@@ -34,21 +34,21 @@ export default NextAuth({ | |
}, | ||
|
||
callbacks: { | ||
async jwt({ token, user, account, profile, isNewUser }) { | ||
async jwt({ token, user, account, profile, isNewUser }) { | ||
const strapiUser = user as StrapiUser | ||
if(strapiUser) { | ||
if (strapiUser) { | ||
token.user = strapiUser.user | ||
token.jwt = strapiUser.jwt | ||
} | ||
if(account) token.account = account | ||
if(profile) token.profile = profile | ||
if (account) token.account = account | ||
if (profile) token.profile = profile | ||
|
||
return token | ||
}, | ||
async session({ session, token, user }) { | ||
if(token) session.token = token | ||
if(user) session.user = user | ||
async session({ session, token, user }) { | ||
if (token) session.token = token | ||
|
||
if (user) session.user = user | ||
else session.user = token.user | ||
|
||
return session | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.