paperclip/ui/src
Nicky Leach ca9c17df60
test(ui): flush passive effects with React act in CompanySkills tests (#12878)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The user interface tests verify company skill installation flows.
> - The install-preview dialog sets state through passive React effects.
> - The local test helper flushed render work but did not flush passive
effects.
> - Timer hops did not guarantee that React completed those effects
before user actions.
> - This pull request delegates the helper to React act and removes the
timer hops.
> - The benefit is deterministic CompanySkills tests without a
product-code change.

## Linked Issues or Issue Description

**What happened?**

The CompanySkills install-preview dialog tests used a timer hop after
opening the dialog. The timer could run before React completed passive
effects. A later click then used stale dialog state.

**Expected behavior**

The test helper must flush passive effects before the test interacts
with the dialog. The tests must pass without a race between timer
callbacks and React scheduler tasks.

**Steps to reproduce**

1. Run the CompanySkills test file many times from the ui directory.
2. Observe intermittent failures that report an empty agent list or a
null slug.
3. Run the same tests with React act to flush passive effects.

**Paperclip version or commit**

Commit 834f33c31b.

**Deployment mode**

Local dev (pnpm dev).

**Installation method**

Built from source (pnpm dev / pnpm build).

**Agent adapter(s) involved**

Not adapter-specific (core bug).

**Database mode**

Not database-related.

## What Changed

- Delegate the local test helper to React act.
- Remove four setTimeout(0) hops that no longer provide synchronization.
- Keep all 29 tests and all product code unchanged.

## Verification

- Run npx vitest run src/pages/CompanySkills.test.tsx from ui/.
- Run pnpm --filter @paperclipai/ui exec tsc --noEmit.
- Confirm that the full CI suite passes.

## Risks

Low risk. The change affects one test helper and one test file. It
changes test synchronization only.

## Model Used

OpenAI Codex, GPT-5, with tool use and code review support. The exact
context window and reasoning configuration are not exposed in this run.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with Fixes: # / Closes #
/ Refs # OR (b) described the issue in-PR following the relevant issue
template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub #NNN / github.com/paperclipai/paperclip URLs)
- [x] My branch name describes the change (for example test/...) and
contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge


Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-09-05 08:40:38 -07:00
..
adapters fix(runner): restore local session and task integrity (#12721) 2026-09-02 16:11:26 -05:00
api feat(connections): add durable GitHub identities and webhooks (#12843) 2026-09-04 18:02:52 -05:00
components refactor(onboarding): reconcile the arc column's width comment with its width (#12875) 2026-09-05 00:32:48 -07:00
context feat(ui): viewer=full document deep link opens the maximized side pane (#12812) 2026-09-03 20:27:25 -10:00
features/connections fix(connections): reuse one-time cloud enrollment (#12891) 2026-09-05 08:42:20 -05:00
fixtures feat(apps): add connection intent setup experience (#12347) 2026-08-29 12:08:35 -05:00
hooks feat(ui): refine streamlined task experience (#12748) 2026-09-03 00:28:02 -07:00
i18n copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
lib feat(codex): add GPT-6 Astra support (#12851) 2026-09-04 11:50:04 -10:00
pages test(ui): flush passive effects with React act in CompanySkills tests (#12878) 2026-09-05 08:40:38 -07:00
plugins copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
App.activity-routing.test.tsx feat(ui): refine streamlined task experience (#12748) 2026-09-03 00:28:02 -07:00
App.cases-routing.test.tsx copy: unify user-facing "company" wording to "organization" (#12243) 2026-08-27 01:04:55 -07:00
App.onboarding-launcher.test.tsx Drop the mission step from the wizard arc (#11935) 2026-08-22 02:28:45 -07:00
App.test.tsx feat(apps): consolidate connector management (#12684) 2026-09-01 14:55:35 -05:00
App.tsx feat(apps): unify permissions and action testing (#12802) 2026-09-03 21:23:26 -05:00
bootstrapSetup.ts fix(security): route paperclipai CLI guidance through safe npx form (CWE-78) (#11400) 2026-08-14 22:11:16 -07:00
connect-flow-preview-main.tsx feat(onboarding): the connect step's sign-in as one continuous sequence (#12863) 2026-09-04 17:48:16 -07:00
connect-model-preview-main.tsx Onboarding: model source tiles, one input canvas, and Storybook coverage for the agent arc (#12613) 2026-09-01 09:57:46 -07:00
index.css feat(onboarding): the connect step's sign-in as one continuous sequence (#12863) 2026-09-04 17:48:16 -07:00
main.tsx feat(apps): add connection intent setup experience (#12347) 2026-08-29 12:08:35 -05:00
vite-env.d.ts Add feedback voting and thumbs capture flow 2026-04-02 09:11:49 -05:00
wizard-preview-main.tsx feat(onboarding): the connect step's sign-in as one continuous sequence (#12863) 2026-09-04 17:48:16 -07:00