You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OAuth UI components (OAuthProviderButtons, ConnectedAccountsCard, DisconnectDialog, OAuthProviderButton) have no tests. The current vitest setup runs in node environment without DOM/jsdom, so Svelte component rendering tests are not possible.
Proposed approach
Add @testing-library/svelte and jsdom (or happy-dom) to dev dependencies
Configure a separate vitest environment for component tests (e.g., *.component.test.ts files use jsdom)
Write tests for:
OAuthProviderButtons: mock fetch, verify buttons render for returned providers, verify nothing renders when no providers
ConnectedAccountsCard: verify connect/disconnect button states based on linkedProviders and hasPassword props
DisconnectDialog: verify confirmation flow, unlink API call, error handling
OAuthProviderButton: verify icon rendering, loading/disabled states
Problem
OAuth UI components (OAuthProviderButtons, ConnectedAccountsCard, DisconnectDialog, OAuthProviderButton) have no tests. The current vitest setup runs in
nodeenvironment without DOM/jsdom, so Svelte component rendering tests are not possible.Proposed approach
@testing-library/svelteandjsdom(orhappy-dom) to dev dependencies*.component.test.tsfiles usejsdom)OAuthProviderButtons: mock fetch, verify buttons render for returned providers, verify nothing renders when no providersConnectedAccountsCard: verify connect/disconnect button states based onlinkedProvidersandhasPasswordpropsDisconnectDialog: verify confirmation flow, unlink API call, error handlingOAuthProviderButton: verify icon rendering, loading/disabled statesContext
Related