ShtukbaseStandard
package file→ .shtukbase/packages/lenses/test/packages-map.test.ts

test/packages-map.test.ts

27 lines, 1.1 KB.

  1. // The package map draws a group as a quiet heading above its cards: no border, no fill, no "Areas" setting
  2. // (the owner's taste, design polish 29.11.2026). Run: `bun test` in the package.
  3. import { describe, expect, test } from 'bun:test';
  4. import { readFileSync } from 'node:fs';
  5. import { join } from 'node:path';
  6. const page = readFileSync(join(import.meta.dir, '..', 'pages', 'base', 'packages.html'), 'utf8');
  7. const rule = (selector: string) => {
  8. const at = page.indexOf(selector + ' {');
  9. return at < 0 ? '' : page.slice(at, page.indexOf('}', at));
  10. };
  11. describe('package map groups', () => {
  12. test('a group has no border, no fill and no padding', () => {
  13. const group = rule('.pm-area');
  14. expect(group).not.toBe('');
  15. expect(group).not.toMatch(/box-shadow|border|background|padding/);
  16. });
  17. test('no rule restyles a group by an area setting', () => {
  18. expect(page).not.toMatch(/data-groups/);
  19. expect(page).not.toMatch(/groups:\s*\{\s*kind/);
  20. expect(page).not.toMatch(/label:\s*"Areas"/);
  21. });
  22. test('no preset names a group look', () => {
  23. expect(page).not.toMatch(/groups:\s*"(white|tint|none)"/);
  24. });
  25. });