Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/desktop/src/__e2e__/oidc-login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
function mockOIDCFlow(page: import('@playwright/test').Page, params: MockOIDCParams = {}) {
const {
state = 'test-state-mock-12345',
code = 'test-auth-code-67890',

Check failure on line 30 in app/desktop/src/__e2e__/oidc-login.spec.ts

View workflow job for this annotation

GitHub Actions / frontend-desktop

'code' is assigned a value but never used
authError,
tokenError,
deviceId = '00000000-0000-0000-0000-000000000001',
Expand Down Expand Up @@ -93,7 +93,7 @@
* The Desktop app reads code from the URL in dev mode,
* or captures it via the Tauri Rust callback server.
*/
async function simulateOIDCCallback(page: import('@playwright/test').Page, code: string, state: string) {

Check failure on line 96 in app/desktop/src/__e2e__/oidc-login.spec.ts

View workflow job for this annotation

GitHub Actions / frontend-desktop

'simulateOIDCCallback' is defined but never used
// Navigate to the callback URL as if TokenDance ID redirected the browser
await page.goto(`/auth/tokendance/callback?code=${code}&state=${state}`, { waitUntil: 'networkidle' });
}
Expand All @@ -119,8 +119,9 @@
expect(url.searchParams.get('scope')).toContain('openid');
} else {
// Login button may not be visible if already on a different page;
// this is fine — we just verify the app loads
expect(true).toBe(true);
// this is fine — we just verify the app rendered without crashing.
await expect(page.locator('#root')).toBeAttached();
await expect(page.locator('#root > *').first()).toBeVisible();
Comment on lines +122 to +124

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert the expected app state, not any visible root child.

Because AppShell is wrapped by ErrorBoundary in app/desktop/src/main.tsx, an error fallback could satisfy #root > * visibility while the application has crashed. Use a stable selector or accessible state specific to the expected fallback/app-shell rendering.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/desktop/src/__e2e__/oidc-login.spec.ts` around lines 122 - 124, Update
the assertions in the OIDC login test to verify the expected AppShell or
fallback-specific state rather than merely checking that any `#root` child is
visible. Use a stable selector or accessible marker corresponding to the
intended rendered application state, while retaining the root attachment check.

}
});

Expand Down
Loading