Skip to content

test(desktop): wait for restored focus - #4644

Merged
Astro-Han merged 1 commit into
apache:mainfrom
Colafornia:fix/storybook-focus-timing
Sep 3, 2026
Merged

test(desktop): wait for restored focus#4644
Astro-Han merged 1 commit into
apache:mainfrom
Colafornia:fix/storybook-focus-timing

Conversation

@Colafornia

Copy link
Copy Markdown
Contributor

Summary

The OAuth connection story could check focus before the next-frame focus restoration completed. Wait for the new connection row to receive focus.

Production behavior is unchanged.

Verification

  • npm run build
  • npm run typecheck
  • Biome lint and format on all tracked files
  • Desktop and UI knip checks
  • Storybook build and smoke — 257 stories, 262 theme renders

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex implemented the test fix, reviewed it, ran verification, and drafted this PR.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Settings focus returns on the next animation frame, so the Storybook
assertion waits for the final state.

Generated-by: Codex
@github-actions github-actions Bot added the effort/XS Under 10 readable lines label Sep 3, 2026

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Correct fix and it matches the file's own idiom: waitFor is already imported and already wraps two other assertions here. Focus that never lands still fails the story, so nothing is weakened. Storybook only, CI green.

@Astro-Han
Astro-Han merged commit 35010f4 into apache:main Sep 3, 2026
2 checks passed
ggbdpq pushed a commit to ggbdpq/maka that referenced this pull request Sep 4, 2026
`OAuthCreateAdoptsExactConnection` asserted focus on the created connection's
button immediately, but the row restores focus on the next frame, so the
assertion could run before the restoration landed.

Wrapping it in `waitFor` matches what the rest of the file already does at two
other assertions, and keeps the assertion's strength: focus that never arrives
still fails.

Storybook story only, no production change.

Generated-by: OpenAI Codex

Generated-by: GLM-5.3-Flash (ZCode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XS Under 10 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants