Skip to content

fix(storybook): fix page delete account storybook#20424

Merged
vpomerleau merged 1 commit intomainfrom
fix-page-delete-account-story
Apr 21, 2026
Merged

fix(storybook): fix page delete account storybook#20424
vpomerleau merged 1 commit intomainfrom
fix-page-delete-account-story

Conversation

@vpomerleau
Copy link
Copy Markdown
Contributor

Because

  • Page Delete account storybook was broken (missing App Context Provider)

This pull request

  • wraps PageDeleteAccount in AppContext.Provider with mockAppContext(), which supplies the missing authClient
  • expands story variants to include both default and passwordless accounts

Issue that this pull request solves

Closes: (issue number)

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

How to review (Optional)

  • Key files/areas to focus on:
  • Suggested review order:
  • Risky or complex parts:

Screenshots (Optional)

image image image

Other information (Optional)

Any other information that is important to this pull request.

Copilot AI review requested due to automatic review settings April 21, 2026 21:41
@vpomerleau vpomerleau requested a review from a team as a code owner April 21, 2026 21:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the broken PageDeleteAccount Storybook stories by providing the required AppContext.Provider and adding a second variant to cover passwordless accounts.

Changes:

  • Wrapes PageDeleteAccount stories with AppContext.Provider using mockAppContext() so required context (e.g., authClient) is present.
  • Adds two story variants: one for accounts with a password and one without a password.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +23 to +29
destroy: () => Promise.resolve(),
} as unknown as Account;

const accountWithoutPassword = {
...MOCK_ACCOUNT,
hasPassword: false,
destroy: () => Promise.resolve(),
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Account.destroy takes a password: string argument (see models/Account.ts), but this story’s mock destroy stub is declared with no parameters. Even though extra args are ignored at runtime, matching the real signature here makes the mock intent clearer and avoids confusion when the component passes the password/empty string.

Suggested change
destroy: () => Promise.resolve(),
} as unknown as Account;
const accountWithoutPassword = {
...MOCK_ACCOUNT,
hasPassword: false,
destroy: () => Promise.resolve(),
destroy: (_password: string) => Promise.resolve(),
} as unknown as Account;
const accountWithoutPassword = {
...MOCK_ACCOUNT,
hasPassword: false,
destroy: (_password: string) => Promise.resolve(),

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +29
destroy: () => Promise.resolve(),
} as unknown as Account;

const accountWithoutPassword = {
...MOCK_ACCOUNT,
hasPassword: false,
destroy: () => Promise.resolve(),
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above: consider updating this mock destroy to accept a password: string parameter to mirror the real Account.destroy(password) API used by PageDeleteAccount.

Suggested change
destroy: () => Promise.resolve(),
} as unknown as Account;
const accountWithoutPassword = {
...MOCK_ACCOUNT,
hasPassword: false,
destroy: () => Promise.resolve(),
destroy: (_password: string) => Promise.resolve(),
} as unknown as Account;
const accountWithoutPassword = {
...MOCK_ACCOUNT,
hasPassword: false,
destroy: (_password: string) => Promise.resolve(),

Copilot uses AI. Check for mistakes.
@vpomerleau vpomerleau merged commit 7b662fe into main Apr 21, 2026
25 checks passed
@vpomerleau vpomerleau deleted the fix-page-delete-account-story branch April 21, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants