Files
deepseek-harness/packages/client/ui-sidebar/tests/scrollbar-quiet-styles.client.spec.ts
imccyu 7ad54e7791 refactor(client): name the compile face in every client test filename
A test file under packages/client now says which face it covers:
`*.client.spec.{ts,tsx}` and its `*.client.{ts,tsx}` helpers belong to the
Client aggregate, `*.host.spec.ts` to the host aggregate. The carrier's four
node-half specs take the Host suffix.

The two suffixes are mutually exclusive, so each aggregate excludes the
other's and both keep one broad test glob: `exclude` wins over `include`, and
`packages/client/**` no longer has to be excluded wholesale from the host
program with per-file `files` entries carved back out of it. A Host-face spec
that reaches only Host source therefore needs no cross-face project
reference, which the split-project rule rejects.

vitest still discovers every file through `**/*.spec.{ts,tsx}`.
2026-08-12 01:41:40 +08:00

34 lines
1.5 KiB
TypeScript

/**
* The quiet-column rule as CSS text: the state SidebarRoot toggles
* (pointer-scrollbars.spec.tsx) hides a scrollbar only through this rule, and
* ui-theme's gate checks the rebinding contract's shape without knowing which
* sheet states which half.
*/
import { readFileSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
import { describe, expect, it } from 'vitest'
const css = readFileSync(fileURLToPath(new URL('../src/client/SidebarRoot.module.css', import.meta.url)), 'utf8')
/** Declarations only: the sheet's prose names the properties it explains. */
const declarationText = css.replace(/\/\*[\s\S]*?\*\//g, ' ')
describe('SidebarRoot.module.css quiet column', () => {
it('rebinds the ui-theme indirection pair to transparent', () => {
// The pair, not the resting thumb alone: rebinding one leaves the other
// painting its base-surface colour the moment the pointer reaches the bar.
const rule = /\.root\.quietBars\s*\{([^{}]*)\}/.exec(declarationText)
expect(rule).not.toBeNull()
const declarations = (rule![1] ?? '').split(';').map(part => part.trim()).filter(Boolean).sort()
expect(declarations).toEqual([
'--dsh-scrollbar-thumb-hover: transparent',
'--dsh-scrollbar-thumb: transparent',
].sort())
})
it('leaves the gutter reservation to the scrolling region', () => {
// Hiding the thumb must not move a row: the reservation lives on the list
// (ui-workspace), so the column states colour only.
expect(declarationText).not.toMatch(/scrollbar-gutter/)
})
})