archivo del paquete→ .shtukbase/packages/lenses/test/packages-map.test.ts
test/packages-map.test.ts
27 líneas, 1.1 KB.
El archivo tal como está en el paquete: el código y sus comentarios no se traducen.
- // The package map draws a group as a quiet heading above its cards: no border, no fill, no "Areas" setting
- // (the owner's taste, design polish 29.11.2026). Run: `bun test` in the package.
- import { describe, expect, test } from 'bun:test';
- import { readFileSync } from 'node:fs';
- import { join } from 'node:path';
- const page = readFileSync(join(import.meta.dir, '..', 'pages', 'base', 'packages.html'), 'utf8');
- const rule = (selector: string) => {
- const at = page.indexOf(selector + ' {');
- return at < 0 ? '' : page.slice(at, page.indexOf('}', at));
- };
- describe('package map groups', () => {
- test('a group has no border, no fill and no padding', () => {
- const group = rule('.pm-area');
- expect(group).not.toBe('');
- expect(group).not.toMatch(/box-shadow|border|background|padding/);
- });
- test('no rule restyles a group by an area setting', () => {
- expect(page).not.toMatch(/data-groups/);
- expect(page).not.toMatch(/groups:\s*\{\s*kind/);
- expect(page).not.toMatch(/label:\s*"Areas"/);
- });
- test('no preset names a group look', () => {
- expect(page).not.toMatch(/groups:\s*"(white|tint|none)"/);
- });
- });