Files
moeka-project/packages
leafyy 7bcd8e5274 test(stage-ui): fix browser fixtures and cleanup (#2492)
## Description

The Unit Test job reaches stage-ui, then fails and stalls in browser
tests. The same failures occur on the parent commit.

- Use the real consciousness store and Pinia refs in context bridge
tests. Check that input requests preserve temperature and top-p.
- Dispose each bridge and Pinia scope after every test, including failed
assertions. This prevents old listeners from receiving later stream
events.
- Create translated module stores during component setup and await card
initialization before drawer interactions. Dispose the fixture stores
after each test.
- Remove the Pinia and Mutex replacements from the context bridge
fixture.

This change only updates two test files.

## Verification

The original fixture reproduced three failures in the two affected
files. The updated files pass all 17 tests. The complete CI test command
passes 2,534 tests, with one skipped test. Stage-ui passes all 822
tests.

- `NODE_OPTIONS=--no-experimental-webstorage pnpm exec vitest run
--config packages/stage-ui/vitest.config.ts --project browser
packages/stage-ui/src/components/misc/character-switcher-drawer.browser.test.ts
packages/stage-ui/src/stores/mods/api/context-bridge.contract.browser.test.ts
--reporter=verbose`
- `NODE_OPTIONS=--no-experimental-webstorage pnpm run test:run`
- `pnpm run typecheck`
- `pnpm run lint`
- `sem diff --staged --no-cosmetics -v --file-exts .ts .tsx`, JSON diff,
and dependent analysis for `mountSwitcher`: no blocking findings.
- `git diff --cached --check`

GitHub CI also passes on this PR: [all nine CI jobs
succeeded](https://github.com/moeru-ai/airi/actions/runs/34306753310),
including [Unit
Test](https://github.com/moeru-ai/airi/actions/runs/34306753310/job/102324934330).

## Additional Context

[Reported CI
failure](https://github.com/moeru-ai/airi/actions/runs/34237304157/job/102098223378)
· [Parent commit
failure](https://github.com/moeru-ai/airi/actions/runs/34212756766/job/102017352566)
2026-09-09 11:55:32 +08:00
..
2026-08-26 20:13:10 +08:00
2026-08-30 02:31:30 +08:00
2026-08-26 20:13:10 +08:00
2026-08-30 02:31:30 +08:00
2026-08-30 02:31:30 +08:00
2026-08-30 02:31:30 +08:00
2026-08-30 02:31:30 +08:00
2026-08-30 02:31:30 +08:00
2026-08-30 02:31:30 +08:00
2026-08-30 02:31:30 +08:00
2026-08-30 02:31:30 +08:00
2026-08-30 02:31:30 +08:00
2026-08-30 02:31:30 +08:00
2026-08-30 02:31:30 +08:00
2026-08-30 02:31:30 +08:00
2026-08-26 20:13:10 +08:00
2026-08-30 02:31:30 +08:00
2026-08-26 20:13:10 +08:00
2026-08-26 20:13:10 +08:00