Skip to content

Fix ESLint warnings in login.spec.ts #2

Description

@kelleyglenn

Description

The e2e/tests/auth/login.spec.ts file has 4 ESLint warnings from the Playwright plugin:

12:5   warning  Avoid having conditionals in tests       playwright/no-conditional-in-test
13:13  warning  Unexpected use of page.waitForTimeout()  playwright/no-wait-for-timeout
27:5   warning  Avoid having conditionals in tests       playwright/no-conditional-in-test
28:13  warning  Unexpected use of page.waitForTimeout()  playwright/no-wait-for-timeout

Why this matters

  • Conditionals in tests: Make tests non-deterministic and harder to debug
  • waitForTimeout(): Brittle timing-based waits; prefer waiting for specific conditions

Suggested fix

Replace waitForTimeout() with proper Playwright waiting mechanisms:

  • page.waitForSelector()
  • page.waitForLoadState()
  • expect().toBeVisible() with auto-waiting

Remove conditionals by either:

  • Ensuring consistent test state via proper setup
  • Splitting into separate test cases

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions