singularity-forge/studio/test/tokens.test.mjs
TÂCHES 920f1bed9a fix(ci): add safe.directory for containerized pipeline job (#1108)
* feat(S01/T01): Scaffolded the `studio` Electron workspace with a workin…

- package.json
- studio/package.json
- studio/electron.vite.config.ts
- studio/src/main/index.ts
- studio/src/preload/index.ts
- studio/src/renderer/src/styles/index.css
- studio/src/renderer/src/App.tsx

* chore: init gsd

* fix(ci): add safe.directory for containerized pipeline job

The Dev Publish job runs inside a Docker container where the checkout
user differs from the container user (root), causing git's dubious
ownership check to reject git operations in version-stamp.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(ci): remove .gsd/.gitignore from tracking

The no-gsd-dir CI check fails when .gsd/ exists as a directory, even
if only .gitignore is tracked inside it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 01:11:52 -06:00

39 lines
1.2 KiB
JavaScript

import test from 'node:test'
import assert from 'node:assert/strict'
import { readFile } from 'node:fs/promises'
const cssPath = new URL('../src/renderer/src/styles/index.css', import.meta.url)
const tokensPath = new URL('../src/renderer/src/lib/theme/tokens.ts', import.meta.url)
test('theme CSS defines required color tokens and font-display block', async () => {
const css = await readFile(cssPath, 'utf8')
for (const token of [
'--color-bg-primary',
'--color-bg-secondary',
'--color-bg-tertiary',
'--color-bg-hover',
'--color-border',
'--color-border-active',
'--color-text-primary',
'--color-text-secondary',
'--color-text-tertiary',
'--color-accent',
'--color-accent-hover',
'--color-accent-muted',
'--font-sans',
'--font-mono'
]) {
assert.match(css, new RegExp(token.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&')))
}
const blockMatches = css.match(/font-display:\s*block;/g) ?? []
assert.equal(blockMatches.length, 5)
})
test('token module exports key theme primitives', async () => {
const tokensFile = await readFile(tokensPath, 'utf8')
assert.match(tokensFile, /accent: '#d4a04e'/)
assert.match(tokensFile, /mono: "'JetBrains Mono'/)
assert.match(tokensFile, /body: '0\.9375rem'/)
})