In Vitest, mock.results is a getter that returns fresh data each time
it's accessed, unlike Jest where it was a static array reference.
Changed from caching the reference to accessing mock.results directly
in each assertion.
Add explicit spacing between adjacent inline elements in template.
This matches the QuotaMeter fix - Vitest/JSDOM correctly doesn't add
spaces between adjacent elements, which is also the Vue 3 behavior.
Vitest renders component text without spaces between text nodes, and this is actually a new vue3 behavior coming as well, so it fixes a legitimate bug to add an explicit space here.
Changed 8 instances of expect(condition === value) to proper
expect(value).toBe(expected) assertions. Also fixed a bug in
upload-queue test where mockedProcess was being called instead
of assigned.
Added injectTestRouter helper to vitest helpers and updated
HistoryExportWizard test to use router. This resolves the
"Cannot read properties of undefined (reading 'resolve')"
error that occurred when components use RouterLink.
Added mock for BroadcastChannel in vitest setup to resolve type mismatch
between Node.js and browser implementations. Pinia uses BroadcastChannel
for state synchronization, which was causing unhandled exceptions during
test runs. The mock extends EventTarget and provides no-op implementations
for postMessage and close methods.
Added dispatchEvent helper to vitest helpers, fixed mockHelpPopovers to export default for Vue components. Updated one test expectation for spacing difference in Vitest rendering.
Fixed JSON imports to use default import instead of import * as, which Vitest handles differently than Jest. Converted jest.fn/spyOn to vi equivalents.
Mock handsontable and @handsontable/vue to avoid core-js dependency
issues in Vitest. The commonjs build of handsontable requires old
core-js modules that aren't available.