import assert from 'node:assert/strict';
import { existsSync, readFileSync } from 'node:fs';
import test from 'node:test';

const previewUrl = new URL('../dc-charging-preview.html', import.meta.url);

test('DC charging preview includes an animated energy path and progress control', () => {
  assert.equal(existsSync(previewUrl), true, 'the standalone preview page should exist');

  const html = readFileSync(previewUrl, 'utf8');
  assert.match(html, /id="charge-progress"/);
  assert.match(html, /class="energy-path"/);
  assert.match(html, /@keyframes energy-flow/);
  assert.match(html, /setProgress\(/);
});
