@@ -5,9 +5,12 @@ import { setupApplicationTest } from 'ember-qunit';
5
5
import { createAuthenticateSession } from 'pix-admin/tests/helpers/test-init' ;
6
6
import { module , test } from 'qunit' ;
7
7
8
+ import setupIntl from '../../../helpers/setup-intl' ;
9
+
8
10
module ( 'Acceptance | authenticated/users/get' , function ( hooks ) {
9
11
setupApplicationTest ( hooks ) ;
10
12
setupMirage ( hooks ) ;
13
+ setupIntl ( hooks ) ;
11
14
12
15
test ( 'access to user details page by URL /users/:id' , async function ( assert ) {
13
16
// when
@@ -20,14 +23,14 @@ module('Acceptance | authenticated/users/get', function (hooks) {
20
23
21
24
test ( 'displays user detail information page' , async function ( assert ) {
22
25
// given
26
+ this . intl = this . owner . lookup ( 'service:intl' ) ;
23
27
const user = await _buildAndAuthenticateUser ( this . server , { email :
'[email protected] ' , username :
null } ) ;
24
28
const expectedOrganizationMembershipsCount = 2 ;
25
29
const expectedParticipationCount = 1 ;
26
30
const expectedCertificationCenterCount = 3 ;
27
31
28
32
// when
29
33
const screen = await visit ( `/users/${ user . id } ` ) ;
30
-
31
34
// then
32
35
assert . dom ( screen . getByRole ( 'heading' , { name : "Informations de l'utilisateur" } ) ) . exists ( ) ;
33
36
assert . dom ( screen . getByRole ( 'heading' , { name : 'Informations prescrit' } ) ) . exists ( ) ;
@@ -43,6 +46,9 @@ module('Acceptance | authenticated/users/get', function (hooks) {
43
46
assert
44
47
. dom ( userNavigation . getByLabelText ( 'Organisations de l’utilisateur' ) )
45
48
. hasText ( `Pix Orga (${ expectedOrganizationMembershipsCount } )` ) ;
49
+ assert
50
+ . dom ( userNavigation . getByRole ( 'link' , { name : this . intl . t ( 'pages.user-details.navbar.cgu-aria-label' ) } ) )
51
+ . exists ( ) ;
46
52
} ) ;
47
53
48
54
test ( 'redirects to list users page when click page title' , async function ( assert ) {
0 commit comments