test: Donut-Vertragstest unabhaengig von Zeilenenden

Die CSS-Dateien werden beim Einlesen auf LF normalisiert, weil
Windows-Checkouts mit core.autocrlf=true CRLF liefern. Die
Vertragspruefungen selbst bleiben unveraendert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Michael 2026-10-01 10:02:53 +02:00
parent d8cb73fb37
commit ba461cb1f7
1 changed files with 5 additions and 3 deletions

View File

@ -4,9 +4,11 @@ import { describe, expect, it } from 'vitest';
import { DonutMetricCard } from '../../src/components/DonutMetricCard/DonutMetricCard';
import { donutArcPath } from '../../src/components/DonutMetricCard/donut-arc';
const styles = readFileSync(new URL('../../src/styles/components.css', import.meta.url), 'utf8');
const tileContract = readFileSync(new URL('../../src/styles/tile-contract.css', import.meta.url), 'utf8');
const tokens = readFileSync(new URL('../../src/styles/ui-tokens.css', import.meta.url), 'utf8');
// Line endings depend on the checkout (CRLF on Windows working copies); the contract is about content.
const readStyle = (file: string) => readFileSync(new URL(`../../src/styles/${file}`, import.meta.url), 'utf8').replace(/\r\n/g, '\n');
const styles = readStyle('components.css');
const tileContract = readStyle('tile-contract.css');
const tokens = readStyle('ui-tokens.css');
describe('DonutMetricCard binding design contract', () => {
it('renders the shared full-circle reference with a bold count above a regular percentage', () => {