Skip to content

[BUG] Stabilize flaky accessibility contrast test after theme changes #1612

Closed

Description

@edelauna

Type

Bug

Problem / Value

The accessibility contrast test can fail while theme colors are still transitioning. This creates false failures and reduces confidence in accessibility checks.

Failed job: https://github.com/Zoo-Code-Org/Zoo-Code/actions/runs/34611927505/job/103304287180?pr=1604

Reproduction evidence

  • The failed check measured 3.73:1 against the required 4.5:1.
  • Another run produced the same intermediate colors and failure.
  • Five nearby runs passed.
  • The final theme colors produce about 14.55:1 contrast.
  • This is not a runner failure, accessibility regression, or PR 1604 regression.

Root cause

The theme helper changes theme classes without waiting for color transitions to finish. The input uses a 150 ms color transition, so the contrast helper can sample intermediate gray values.

Expected behavior

Contrast checks must measure stable final theme colors and produce consistent results across repeated runs.

Recommended approach

Disable transitions for this test, or wait for stable computed styles before measuring contrast.

Acceptance criteria

  • The test does not measure colors during a theme transition.
  • Repeated runs produce stable contrast results.
  • The test still fails when final colors do not meet the required contrast ratio.
  • The fix does not weaken the 4.5:1 requirement.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions