Include the new GraphQL property in test mocks

This commit is contained in:
Quentin Gliech committed 2025-02-24 14:40:04 +01:00
1 parent 03eaeca8a6
commit dbcb051de9
2 files changed
+11

No files matched your search

+10
View File
@@ -34,11 +34,13 @@ const userProfileHandler = ({
passwordLoginEnabled,
passwordChangeAllowed,
emailTotalCount,
hasPassword,
}: {
emailChangeAllowed: boolean;
passwordLoginEnabled: boolean;
passwordChangeAllowed: boolean;
emailTotalCount: number;
hasPassword: boolean;
}): GraphQLHandler =>
mockUserProfileQuery(() =>
HttpResponse.json({
@@ -47,6 +49,7 @@ const userProfileHandler = ({
__typename: "BrowserSession",
id: "session-id",
user: {
hasPassword,
emails: {
totalCount: emailTotalCount,
},
@@ -130,6 +133,7 @@ export const MultipleEmails: Story = {
passwordChangeAllowed: true,
emailChangeAllowed: true,
emailTotalCount: 3,
hasPassword: true,
}),
threeEmailsHandler,
],
@@ -147,6 +151,7 @@ export const NoEmails: Story = {
passwordChangeAllowed: true,
emailChangeAllowed: false,
emailTotalCount: 0,
hasPassword: true,
}),
],
},
@@ -163,6 +168,7 @@ export const MultipleEmailsNoChange: Story = {
passwordChangeAllowed: true,
emailChangeAllowed: false,
emailTotalCount: 3,
hasPassword: true,
}),
threeEmailsHandler,
],
@@ -180,6 +186,7 @@ export const NoEmailChange: Story = {
passwordChangeAllowed: true,
emailChangeAllowed: false,
emailTotalCount: 1,
hasPassword: true,
}),
],
},
@@ -196,6 +203,7 @@ export const NoPasswordChange: Story = {
passwordChangeAllowed: false,
emailChangeAllowed: true,
emailTotalCount: 1,
hasPassword: true,
}),
],
},
@@ -212,6 +220,7 @@ export const NoPasswordLogin: Story = {
passwordChangeAllowed: false,
emailChangeAllowed: true,
emailTotalCount: 1,
hasPassword: true,
}),
],
},
@@ -228,6 +237,7 @@ export const NoPasswordNoEmailChange: Story = {
passwordChangeAllowed: false,
emailChangeAllowed: false,
emailTotalCount: 0,
hasPassword: false,
}),
],
},
+1
View File
@@ -91,6 +91,7 @@ export const handlers = [
__typename: "BrowserSession",
id: "browser-session-id",
user: {
hasPassword: true,
emails: {
totalCount: 1,
},