Skip to content

Commit dbcb051

Browse files
committed
Include the new GraphQL property in test mocks
1 parent 03eaeca commit dbcb051

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

frontend/stories/routes/index.stories.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ const userProfileHandler = ({
3434
passwordLoginEnabled,
3535
passwordChangeAllowed,
3636
emailTotalCount,
37+
hasPassword,
3738
}: {
3839
emailChangeAllowed: boolean;
3940
passwordLoginEnabled: boolean;
4041
passwordChangeAllowed: boolean;
4142
emailTotalCount: number;
43+
hasPassword: boolean;
4244
}): GraphQLHandler =>
4345
mockUserProfileQuery(() =>
4446
HttpResponse.json({
@@ -47,6 +49,7 @@ const userProfileHandler = ({
4749
__typename: "BrowserSession",
4850
id: "session-id",
4951
user: {
52+
hasPassword,
5053
emails: {
5154
totalCount: emailTotalCount,
5255
},
@@ -130,6 +133,7 @@ export const MultipleEmails: Story = {
130133
passwordChangeAllowed: true,
131134
emailChangeAllowed: true,
132135
emailTotalCount: 3,
136+
hasPassword: true,
133137
}),
134138
threeEmailsHandler,
135139
],
@@ -147,6 +151,7 @@ export const NoEmails: Story = {
147151
passwordChangeAllowed: true,
148152
emailChangeAllowed: false,
149153
emailTotalCount: 0,
154+
hasPassword: true,
150155
}),
151156
],
152157
},
@@ -163,6 +168,7 @@ export const MultipleEmailsNoChange: Story = {
163168
passwordChangeAllowed: true,
164169
emailChangeAllowed: false,
165170
emailTotalCount: 3,
171+
hasPassword: true,
166172
}),
167173
threeEmailsHandler,
168174
],
@@ -180,6 +186,7 @@ export const NoEmailChange: Story = {
180186
passwordChangeAllowed: true,
181187
emailChangeAllowed: false,
182188
emailTotalCount: 1,
189+
hasPassword: true,
183190
}),
184191
],
185192
},
@@ -196,6 +203,7 @@ export const NoPasswordChange: Story = {
196203
passwordChangeAllowed: false,
197204
emailChangeAllowed: true,
198205
emailTotalCount: 1,
206+
hasPassword: true,
199207
}),
200208
],
201209
},
@@ -212,6 +220,7 @@ export const NoPasswordLogin: Story = {
212220
passwordChangeAllowed: false,
213221
emailChangeAllowed: true,
214222
emailTotalCount: 1,
223+
hasPassword: true,
215224
}),
216225
],
217226
},
@@ -228,6 +237,7 @@ export const NoPasswordNoEmailChange: Story = {
228237
passwordChangeAllowed: false,
229238
emailChangeAllowed: false,
230239
emailTotalCount: 0,
240+
hasPassword: false,
231241
}),
232242
],
233243
},

frontend/tests/mocks/handlers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export const handlers = [
9191
__typename: "BrowserSession",
9292
id: "browser-session-id",
9393
user: {
94+
hasPassword: true,
9495
emails: {
9596
totalCount: 1,
9697
},

0 commit comments

Comments
 (0)