Files
SHiNE-server/shine-UI/tests/tg-midnight-theme.test.mjs
T

29 lines
1.2 KiB
JavaScript

import test from 'node:test';
import assert from 'node:assert/strict';
import {
PALETTE_PRESETS, PALETTE_ROLES, resolvePalette,
} from '../js/services/theme-service.js';
const settings = (preset) => ({ preset, custom: { dark: {}, light: {} } });
test('новая палитра доступна в настройках, а стандартная сохранена', () => {
assert.equal(PALETTE_PRESETS.tg_midnight.label, 'TG · Midnight');
assert.equal(PALETTE_PRESETS.aurora.label, 'Сияние');
});
test('каждая роль в тёмном и светлом TG содержит корректный HEX', () => {
for (const mode of ['dark', 'light']) {
const result = resolvePalette(mode, settings('tg_midnight'));
for (const { id } of PALETTE_ROLES) {
assert.match(result[id], /^#[0-9a-f]{6}$/i, `${mode}/${id}`);
}
}
});
test('у тёмной темы синий акцент и отдельный цвет исходящего сообщения', () => {
const c = resolvePalette('dark', settings('tg_midnight'));
assert.equal(c.background, '#151e27');
assert.equal(c.accent, '#2596e8');
assert.equal(c['bubble-out'], '#456f69');
});