@@ -26,14 +26,20 @@ module('Integration | Component | authentication | login-or-register-oidc', func
26
26
}
27
27
this . owner . register ( 'service:oidcIdentityProviders' , OidcIdentityProvidersStub ) ;
28
28
29
- this . set ( 'givenName' , 'Mélusine' ) ;
30
- this . set ( 'familyName' , 'TITEGOUTTE' ) ;
29
+ const userInfo = {
30
+ firstName : 'Mélusine' ,
31
+ lastName : 'TITEGOUTTE' ,
32
+ } ;
33
+
34
+ this . set ( 'userInfo' , userInfo ) ;
31
35
} ) ;
32
36
33
37
test ( 'should display heading' , async function ( assert ) {
34
38
// given & when
35
39
const screen = await render (
36
- hbs `<Authentication::LoginOrRegisterOidc @identityProviderSlug={{this.identityProviderSlug}} />` ,
40
+ hbs `<Authentication::LoginOrRegisterOidc @identityProviderSlug={{this.identityProviderSlug}}
41
+ @userInfo={{this.userInfo}}
42
+ />` ,
37
43
) ;
38
44
39
45
// then
@@ -51,8 +57,7 @@ module('Integration | Component | authentication | login-or-register-oidc', func
51
57
const screen = await render (
52
58
hbs `<Authentication::LoginOrRegisterOidc
53
59
@identityProviderSlug={{this.identityProviderSlug}}
54
- @givenName={{this.givenName}}
55
- @familyName={{this.familyName}}
60
+ @userInfo={{this.userInfo}}
56
61
/>` ,
57
62
) ;
58
63
@@ -65,20 +70,8 @@ module('Integration | Component | authentication | login-or-register-oidc', func
65
70
) ;
66
71
assert . ok ( screen . getByRole ( 'button' , { name : t ( 'pages.login-or-register-oidc.register-form.button' ) } ) ) ;
67
72
assert . ok ( screen . getByText ( 'Partenaire OIDC' ) ) ;
68
- assert . ok (
69
- screen . getByText (
70
- t ( 'pages.login-or-register-oidc.register-form.information.given-name' , {
71
- givenName : 'Mélusine' ,
72
- } ) ,
73
- ) ,
74
- ) ;
75
- assert . ok (
76
- screen . getByText (
77
- t ( 'pages.login-or-register-oidc.register-form.information.family-name' , {
78
- familyName : 'TITEGOUTTE' ,
79
- } ) ,
80
- ) ,
81
- ) ;
73
+ assert . ok ( screen . getByText ( `${ t ( 'pages.login-or-register-oidc.register-form.information.firstName' ) } Mélusine` ) ) ;
74
+ assert . ok ( screen . getByText ( `${ t ( 'pages.login-or-register-oidc.register-form.information.lastName' ) } TITEGOUTTE` ) ) ;
82
75
assert . ok ( screen . getByRole ( 'checkbox' , { name : t ( 'common.cgu.label' ) } ) ) ;
83
76
assert . ok ( screen . getByRole ( 'link' , { name : t ( 'common.cgu.cgu' ) } ) ) ;
84
77
assert . ok ( screen . getByRole ( 'link' , { name : t ( 'common.cgu.data-protection-policy' ) } ) ) ;
@@ -91,8 +84,7 @@ module('Integration | Component | authentication | login-or-register-oidc', func
91
84
const screen = await render (
92
85
hbs `<Authentication::LoginOrRegisterOidc
93
86
@identityProviderSlug={{this.identityProviderSlug}}
94
- @givenName={{this.givenName}}
95
- @familyName={{this.familyName}}
87
+ @userInfo={{this.userInfo}}
96
88
/>` ,
97
89
) ;
98
90
@@ -106,20 +98,8 @@ module('Integration | Component | authentication | login-or-register-oidc', func
106
98
assert . ok ( screen . getByRole ( 'textbox' , { name : t ( 'pages.login-or-register-oidc.login-form.email' ) } ) ) ;
107
99
assert . ok ( screen . getByRole ( 'link' , { name : t ( 'pages.sign-in.forgotten-password' ) } ) ) ;
108
100
assert . ok ( screen . getByRole ( 'button' , { name : t ( 'pages.login-or-register-oidc.login-form.button' ) } ) ) ;
109
- assert . ok (
110
- screen . getByText (
111
- t ( 'pages.login-or-register-oidc.register-form.information.given-name' , {
112
- givenName : 'Mélusine' ,
113
- } ) ,
114
- ) ,
115
- ) ;
116
- assert . ok (
117
- screen . getByText (
118
- t ( 'pages.login-or-register-oidc.register-form.information.family-name' , {
119
- familyName : 'TITEGOUTTE' ,
120
- } ) ,
121
- ) ,
122
- ) ;
101
+ assert . ok ( screen . getByText ( `${ t ( 'pages.login-or-register-oidc.register-form.information.firstName' ) } Mélusine` ) ) ;
102
+ assert . ok ( screen . getByText ( `${ t ( 'pages.login-or-register-oidc.register-form.information.lastName' ) } TITEGOUTTE` ) ) ;
123
103
} ) ;
124
104
} ) ;
125
105
} ) ;
0 commit comments