Files
gods-eye-view/src/ui/displayGroups.test.mjs
T

21 lines
792 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// src/ui/displayGroups.test.mjs — added groups reach the Display
// panel's store on the page's Pinia.
import test from 'node:test';
import assert from 'node:assert/strict';
import { publishDisplayGroup } from './displayGroups.js';
import { useDisplayStore } from './stores/display.js';
import { applicationPinia } from './vueRuntime.js';
test('publishDisplayGroup shows a group on the page’s Display panel, and takes it away', () => {
const store = useDisplayStore(applicationPinia());
publishDisplayGroup('conditions', {
rows: [{ kind: 'note', id: 'status', text: 'Nothing here' }],
});
assert.deepEqual(
store.groups.map((g) => [g.id, g.rows.length]),
[['conditions', 1]],
);
publishDisplayGroup('conditions', null);
assert.deepEqual(store.groups, []);
});