brendmanager/test/visual.test.js
Peppa b1674516ab
All checks were successful
peppa/lint lint: success за 1с
peppa/test test: success за 0с
ci / checks (pull_request) Successful in 5s
deploy / deploy (pull_request) Successful in 2s
BRM-23: визуальная система бренда — палитра, шрифты, образцы Telegram и LinkedIn
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 21:39:52 +05:00

25 lines
1.1 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { test } from 'node:test';
import assert from 'node:assert/strict';
import { existsSync, readFileSync } from 'node:fs';
import { C, contrast } from '../design/brand-visual/build.mjs';
test('Основной текст читается: контраст не ниже 4,5', () => {
for (const [a, b] of [['graphite', 'milk'], ['navy', 'milk'], ['terracotta', 'milk'], ['milk', 'navy']]) {
assert.ok(contrast(C[a], C[b]) >= 4.5, `${a} на ${b}`);
}
});
test('Образцы на месте: 4 вида × 2 варианта, PNG и SVG', () => {
for (const n of ['telegram-post', 'telegram-cover', 'linkedin-post', 'linkedin-cover']) {
for (const v of ['plain', 'photo']) {
for (const e of ['png', 'svg']) assert.ok(existsSync(`design/brand-visual/${n}-${v}.${e}`), `${n}-${v}.${e}`);
}
}
});
test('Пока нет согласования Татьяны — статус «черновик»', () => {
const d = readFileSync('docs/visual-system.md', 'utf8');
assert.match(d, /Статус: черновик/);
assert.match(d, /Дата согласования: —/);
});