correction test

This commit is contained in:
eric committed 2022-12-11 15:45:31 +01:00
1 parent fa394760ac
commit e73c965078
10 files changed
+2068 -773

No files matched your search

+2 -2
View File
@@ -41,7 +41,7 @@ type Props = {
csrfToken: Token
}
const MainPage = ({ csrfToken }: Props) => {
const Connexion = ({ csrfToken }: Props) => {
const { data: session } = useSession();
const validationSchema = Yup.object().shape({
@@ -182,6 +182,6 @@ const MainPage = ({ csrfToken }: Props) => {
</>)
};
export default MainPage;
export default Connexion;
+4 -19
View File
@@ -51,7 +51,7 @@ type ResponseData = {
const MainPage = () => {
const Index = () => {
const { data: session } = useSession();
const [response, setResponse] = useState<ResponseData | null>(null)
@@ -193,6 +193,7 @@ const MainPage = () => {
<div className="form-group mx-auto my-3 w-100">
<input type="text"
id="codeInput" aria-describedby="codeHelp"
data-testid="codeInput"
placeholder="A293049430..."
minLength={10}
maxLength={10}
@@ -204,23 +205,18 @@ const MainPage = () => {
<div className="invalid-feedback alert alert-danger">{errors.codeCadeau?.message}</div>
</div>
<div className="form-group mx-auto my-3 w-100">
<button type="submit" className={`${style['aButton']} btn btn-primary`}>Découvrir mon cadeau !</button>
<button type="submit" data-testid="submit" className={`${style['aButton']} btn btn-primary`}>Découvrir mon cadeau !</button>
</div>
</form>
</div>
</div>}
{winAnimation && <div className="col-12 align-items-center d-flex flex-column">
<div className={`${style['cadeau-bloc-content']} col-12 col-md-6`} onClick={() => setWinAnimation(false)}
>
<div className={`${style['cadeau-bloc']}`}>
<h1>Vous avez gagnez : un {response.winProduct.nomProduit.toLowerCase()} !</h1>
</div>
</div>
<div className={`${style['imageWrapper']}`}>
<Image
src={arrowUp}
@@ -231,22 +227,11 @@ const MainPage = () => {
className={`${style['rotatingImage']}`}
/>
</div>
<div className="row">
<button onClick={getCadeau} className={`${style['aButton']} btn btn-primary`}>Voir mes cadeaux !</button>
<button onClick={() => setWinAnimation(false)} className={`${style['aButton']} btn btn-primary mt-2`}>Rejouer un ticket !</button>
</div>
</div>}
</div>
<div className={`${style['footerGrass']} position-absolute`}>
<Image
@@ -261,4 +246,4 @@ const MainPage = () => {
);
};
export default MainPage;
export default Index;
+1 -1
View File
@@ -252,7 +252,7 @@ const MonCompte = (props: Props) => {
<th scope="row">{++index}</th>
<td>{info.codeCadeau}</td>
<td>{info.produit.nomProduit}</td>
<td>{info.produit.retrait ? '❌ déja récupéré' : '✔️ venir me chercher !'}</td>
<td>{!info.produit.retrait ? '❌ déja récupéré' : '✔️ venir me chercher !'}</td>
</tr>
})}
</tbody>