Commit fa8efc5
authored
fix(069-B2): green dashboard-usage-switcher unit tests (MCP-900) (#576)
The 069-B1 switcher tests broke when 069-B2 (#571) swapped the inline
usage panel for the real async Usage.vue. Two mount-side problems:
- The usage panel wrapper carried v-if="usageEverActive", so it was
absent from the DOM on first paint and the exists() assertion failed.
Move the lazy gate onto the inner <Suspense> instead: the wrapper div
is now always present (hidden via v-show), while the chart bundle +
usage fetch inside UsageView still mount only on first switch (SC-004),
and the Overview subtree is preserved across switches (SC-006).
- shallowMount stubbed both <Suspense> and the async UsageView, so the
real Usage.vue never rendered (no fetch, no window buttons). Un-stub
Suspense and swap the async wrapper for an eagerly-imported Usage.vue
so the fetch-on-activation and window-re-fetch logic actually runs; a
dynamic import() never settles inside flushPromises + Suspense. Usage's
chart grandchildren stay shallow-stubbed (no jsdom canvas).
Related #5711 parent cf85600 commit fa8efc5
2 files changed
Lines changed: 25 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
61 | 68 | | |
62 | 69 | | |
63 | 70 | | |
| |||
71 | 78 | | |
72 | 79 | | |
73 | 80 | | |
74 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
75 | 92 | | |
76 | 93 | | |
77 | 94 | | |
| |||
0 commit comments