Skip to content

Commit

Permalink
fix: fin unit test and version
Browse files Browse the repository at this point in the history
  • Loading branch information
pYassine committed Nov 29, 2023
1 parent cadbe04 commit 70f6c5e
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 28 deletions.
6 changes: 6 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ fileignoreconfig:
checksum: b66659fea19859e55afaf0ed47519f0804857e486b2ecc6b01d5ae96f1a86a0b
- filename: packages/backend/src/users/dto/reset-password.dto.ts
checksum: 459ec0c5e439bca5375d3a06f4868f8078ca2ad1895fdc5c84bc81cc6bc394fc
- filename: packages/backend/src/users/users.public.controller.spec.ts
checksum: c92d7fdda68498beff9b1680e5cc4b4ee6f0d658bb5a25efd6dd228fd8ce061e
- filename: packages/frontend/src/app/modules/general/components/login/login.component.ts
checksum: 478ac6427b28b5473166ea12bc5ffe275d6dfb1bf3c190c1d852012907f4d317
- filename: packages/frontend/src/app/modules/users/components/user-structure-password-form/user-structure-password-form.component.html
checksum: 6b7878776dbcf983b920e6fdb090a52f5f79f3e4e36187c1460aff17c0cfba83
- filename: packages/frontend/src/app/modules/users/components/user-structure-password-form/user-structure-password-form.component.spec.ts
checksum: 7749036582dd467fd5c71aba534aec66fecabc3185b7fd7ee75705204877b654
- filename: packages/frontend/src/assets/files/news.json
checksum: eef674a077a8c6b56e087ae5d664b10ba956b435f6e29cc241f90ba55f8c1f7a
- filename: packages/portail-usagers/src/app/modules/general/components/_static/cgu/cgu.component.html
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@domifa/backend",
"private": true,
"version": "2.142.0",
"version": "2.145.0",
"description": "",
"author": "",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export class InteractionsDeletor {
usagerUUID: usager.uuid,
type: In(INTERACTION_OK_LIST),
content: Not(Like("%Courrier remis au mandataire%")),
uuid: Not(interaction.uuid),
},
select: {
dateInteraction: true,
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/users/users.public.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ describe("Users Public Controller", () => {
const responseOk = await supertest(context.app.getHttpServer())
.post("/users/reset-password")
.send({
password: "Azerty012345",
passwordConfirmation: "Azerty012345",
password: "Azerty012345!",
passwordConfirmation: "Azerty012345!",
token: userSecurityDatas.temporaryTokens.token,
userId: "1",
});
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@domifa/frontend",
"version": "2.142.0",
"version": "2.145.0",
"main": "index.js",
"author": "Incubateur des Ministères Sociaux <[email protected]> (https://incubateur.social.gouv.fr)",
"license": "Apache-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ describe("RegisterUserComponent", () => {
component.userForm.controls.passwordConfirmation.setValue("1234567891011");
expect(component.userForm.errors).toBeNull();
expect(component.userForm.controls.password.errors).toEqual({
hasSpecialCharacter: true,
hasCapitalCase: true,
hasLowerCase: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
<p
class="my-1"
[ngClass]="
parentFormGroup.controls.password.hasError('required') ||
parentFormGroup.controls.password.hasError('hasNumber')
parentFormGroup.controls.password?.errors?.required ||
parentFormGroup.controls.password?.errors?.hasNumber
? 'text-danger'
: 'text-success'
"
Expand All @@ -58,8 +58,8 @@
aria-hidden="true"
[icon]="[
'fas',
parentFormGroup.controls.password.hasError('required') ||
parentFormGroup.controls.password.hasError('hasNumber')
parentFormGroup.controls.password?.errors?.required ||
parentFormGroup.controls.password?.errors?.hasNumber
? 'times-circle'
: 'check-circle'
]"
Expand All @@ -69,17 +69,17 @@
<p
class="my-1"
[ngClass]="
parentFormGroup.controls.password.hasError('required') ||
parentFormGroup.controls.password.hasError('hasCapitalCase')
parentFormGroup.controls.password?.errors?.required ||
parentFormGroup.controls.password?.errors?.hasCapitalCase
? 'text-danger'
: 'text-success'
"
>
<fa-icon
[icon]="[
'fas',
parentFormGroup.controls.password.hasError('required') ||
parentFormGroup.controls.password.hasError('hasCapitalCase')
parentFormGroup.controls.password?.errors?.required ||
parentFormGroup.controls.password?.errors?.hasCapitalCase
? 'times-circle'
: 'check-circle'
]"
Expand All @@ -90,8 +90,8 @@
<p
class="my-1"
[ngClass]="
parentFormGroup.controls.password.hasError('required') ||
parentFormGroup.controls.password.hasError('hasLowerCase')
parentFormGroup.controls.password?.errors?.required ||
parentFormGroup.controls.password?.errors?.hasLowerCase
? 'text-danger'
: 'text-success'
"
Expand All @@ -100,8 +100,8 @@
aria-hidden="true"
[icon]="[
'fas',
parentFormGroup.controls.password.hasError('required') ||
parentFormGroup.controls.password.hasError('hasLowerCase')
parentFormGroup.controls.password?.errors?.required ||
parentFormGroup.controls.password?.errors?.hasLowerCase
? 'times-circle'
: 'check-circle'
]"
Expand All @@ -111,9 +111,8 @@
<p
class="my-1"
[ngClass]="
parentFormGroup.controls.password.hasError('required') ||
parentFormGroup.controls.password.hasError('minlength') ||
parentFormGroup.controls.password.hasError('maxlength')
parentFormGroup.controls.password?.errors?.required ||
parentFormGroup.controls.password?.errors?.hasSpecialCharacter
? 'text-danger'
: 'text-success'
"
Expand All @@ -122,9 +121,32 @@
aria-hidden="true"
[icon]="[
'fas',
parentFormGroup.controls.password.hasError('required') ||
parentFormGroup.controls.password.hasError('minlength') ||
parentFormGroup.controls.password.hasError('maxlength')
parentFormGroup.controls.password?.errors?.required ||
parentFormGroup.controls.password?.errors?.hasSpecialCharacter
? 'times-circle'
: 'check-circle'
]"
></fa-icon>
Au moins un caractère spécial:
@[]^_!"#$%&amp;&apos;()*+,\-./:;&lbrace;&rbrace;&lt;&gt;=|~?
</p>
<p
class="my-1"
[ngClass]="
parentFormGroup.controls.password?.errors?.required ||
parentFormGroup.controls.password?.errors?.minlength ||
parentFormGroup.controls.password?.errors?.maxlength
? 'text-danger'
: 'text-success'
"
>
<fa-icon
aria-hidden="true"
[icon]="[
'fas',
parentFormGroup.controls.password?.errors?.required ||
parentFormGroup.controls.password?.errors?.minlength ||
parentFormGroup.controls.password?.errors?.maxlength
? 'times-circle'
: 'check-circle'
]"
Expand Down Expand Up @@ -191,7 +213,7 @@
class="text-danger col-md-12"
*ngIf="
passwordConfirmation &&
parentFormGroup.controls.passwordConfirmation.hasError('required')
parentFormGroup.controls.passwordConfirmation?.errors?.required
"
>
La confirmation du mot de passe est obligatoire
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ describe("UserStructurePasswordFormComponent", () => {

it("Passwords OK", () => {
const testPasswords = [
"Azerty0123456",
"LsKVYkXBxDR3",
"Azerty0123456!",
"LsKVYkXBxDR3!",
"!!!!!!V3K5nWvq84Fj",
" §'/(//(nvew3gKvzgKn",
"x$rQAzhmaW(2Fzuk",
"Allez les bleus2022",

"Allez les bleus2022!",
"cpXJydcMV7WjuVc7E2nDIpgHvt)LXhexqh#HvSVN8W6u&x8*LnmXVU&m@5uzfrD",
];
component.newPasswordForm();
Expand Down
2 changes: 1 addition & 1 deletion packages/portail-usagers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@domifa/portail-usagers",
"version": "2.125.0",
"version": "2.145.0",
"main": "index.js",
"author": "Incubateur des Ministères Sociaux <[email protected]> (https://incubateur.social.gouv.fr)",
"license": "Apache-2.0",
Expand Down

0 comments on commit 70f6c5e

Please sign in to comment.