Commit ce7b824
test: centralize unit test isolation and shared automocks (Comfy-Org#15104)
## Summary
Combine the test-isolation cleanup and shared component automocks from
the stacked PR series into one merge. The aggregate removes redundant
per-suite setup while preserving within-test resets and
behavior-specific cleanup.
## Constituent changes
- Comfy-Org#15072 — remove 249 redundant `mockReset()`, `mockClear()`, and
`vi.clearAllMocks()` calls across 120 files, relying on Vitest's
configured `mockReset` and `restoreMocks` behavior.
- Comfy-Org#15074 — clear `sessionStorage` in the shared Vitest `beforeEach` and
remove 28 redundant cleanup calls across 21 suites, retaining the
fast-check iteration reset.
- Comfy-Org#15075 — rely on the shared testing Pinia and remove 67 redundant
`setActivePinia(createPinia())` calls across 60 files, retaining
deliberate within-test and independent-store resets.
- Comfy-Org#15082 — clear `document.body` in the shared Vitest setup and remove
28 redundant body resets across 26 suites, preserving behavior-specific
DOM replacement.
- Comfy-Org#15084 — centralize Testing Library cleanup, including scoped website
cleanup for its `globals: false` project, and remove 23 redundant
lifecycle registrations while preserving mid-test cleanup.
- Comfy-Org#15090 — reset browser history to `/` in the shared Vitest setup and
remove five suite-local URL resets while retaining URL mutations used as
test inputs.
- Comfy-Org#15100 — replace three inline Select test doubles with opt-in
colocated Vitest automocks for the Select component family and include
Vue manual mocks in Knip's Vitest entry pattern.
- Comfy-Org#15101 — replace five inline Slider factories with an opt-in colocated
range-input automock that preserves accessibility, numeric conversion,
bounds, step, and array-valued `v-model` behavior.
- Comfy-Org#15104 — replace two queue-menu Popover factories with an opt-in
colocated automock and shared close spy, reset by Vitest's configured
`mockReset` behavior.
## Verification
- root unit suite: 1,160 files passed; 15,926 tests passed, 8 skipped
- `pnpm lint`
- `pnpm typecheck`
- `pnpm format:check`
- `pnpm knip`
---------
Co-authored-by: Amp <amp@ampcode.com>1 parent d2f611b commit ce7b824
243 files changed
Lines changed: 219 additions & 1130 deletions
File tree
- apps/website
- src
- components
- pricing
- product/local
- templates/model-launch
- test
- utils
- src
- components
- bottomPanel/tabs/shortcuts
- boundingBoxes
- builder
- dialog
- confirm
- content
- signin
- error
- graph
- selectionToolbox
- helpcenter
- honeyToast
- load3d
- controls
- viewer
- maskeditor
- queue
- job
- rightSidePanel
- errors
- parameters
- searchbox
- sidebar/tabs
- nodeLibrary
- queue
- topbar
- ui
- __mocks__
- select/__mocks__
- slider/__mocks__
- videoEdit
- composables
- auth
- billing
- boundingBoxes
- canvas
- graph
- maskeditor
- queue
- core/graph/subgraph
- extensions/core
- load3d
- lib/litegraph/src
- utils
- platform
- assets
- components
- composables
- utils
- auth
- session
- unified
- cloud
- oauth
- onboarding
- subscription
- components
- composables
- keybindings
- missingMedia
- missingModel
- components
- composables
- nodeReplacement
- onboarding
- remote/comfyui
- secrets/components
- settings
- components
- composables
- surveys
- telemetry
- nodeAdded
- providers
- cloud
- host
- searchQuery
- utils/__tests__
- updates/common
- workflow
- core/services
- management/stores
- persistence
- base
- composables
- migration
- stores
- sharing
- components
- services
- utils
- templates/composables
- workspace
- components
- dialogs/settings
- composables
- stores
- renderer
- core
- canvas/links
- layout/sync
- thumbnail
- extensions
- compositor/composables
- firstRunTour
- gettingStarted
- nudge
- roles
- tour
- layerEditor
- components
- composables
- linearMode
- minimap/composables
- vueNodes
- composables
- layout
- widgets
- components
- form/dropdown
- composables
- audio
- glsl
- three
- scripts
- services
- stores
- workspace
- utils
- workbench/extensions/manager
- components/manager
- button
- packCard
- composables
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | 7 | | |
12 | 8 | | |
13 | 9 | | |
| |||
Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | 8 | | |
13 | 9 | | |
14 | 10 | | |
| |||
Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | 38 | | |
43 | 39 | | |
44 | 40 | | |
| |||
Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | 7 | | |
12 | 8 | | |
13 | 9 | | |
| |||
Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | 8 | | |
13 | 9 | | |
14 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | 97 | | |
99 | | - | |
100 | 98 | | |
101 | 99 | | |
102 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
0 commit comments