Install ReUI (MCP, skill, @reui registry, Tailwind v4, shadcn base-nova) and move the shared UI onto it: Button, Tag, Check, Input/Textarea, Segmented, Alert, Panel, Dialog, Tooltip, Menu and Select (Popover), Toast (sonner), the Table frame (DataGrid), the Dashboard KPI strip, the shnt Ops palette, Geist and the type scale. Design only: behaviour, texts and roles are unchanged. Tests that asserted the old DOM were updated; the tests now format numbers in English wherever they run. docs/reui-migration-plan.md records the plan and its decisions. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
29 lines
1.1 KiB
JavaScript
29 lines
1.1 KiB
JavaScript
import { describe, expect, it } from 'vitest'
|
|
import { ALLOWED, check, findBreaks } from './check-word-breaks.mjs'
|
|
|
|
/*
|
|
The gate behind "a name is never cut letter by letter". It runs inside `npm test`,
|
|
as the colour gate does, so the rule is checked wherever the suite is.
|
|
*/
|
|
|
|
describe('word breaks', () => {
|
|
it('src/ breaks inside words only where the allowed list says why', () => {
|
|
expect(check()).toEqual([])
|
|
})
|
|
|
|
it('every allowed entry says why', () => {
|
|
for (const a of ALLOWED) expect(a.reason.length).toBeGreaterThan(40)
|
|
})
|
|
|
|
it('finds the three declarations, with the selector that holds each', () => {
|
|
const css = '.a { word-break: break-all; }\ntd .b, .c { color: var(--ink); overflow-wrap: anywhere; }\n.d{word-break:break-word}'
|
|
expect(findBreaks(css).map((b) => [b.selector, b.value])).toEqual([
|
|
['.a', 'break-all'], ['td .b, .c', 'anywhere'], ['.d', 'break-word'],
|
|
])
|
|
})
|
|
|
|
it('lets through the wrap that keeps words whole, and a rule quoted in a comment', () => {
|
|
expect(findBreaks('/* was `word-break: break-all` */ .a { overflow-wrap: break-word; word-break: normal; }')).toEqual([])
|
|
})
|
|
})
|