Replace project with current server release and Windows setup
Import the 2026-10-09 source release, Fastify/SQLite backend, restored source assets, and analytics-enabled server build. Replace files from the previous release while retaining the existing repository history. Make builds portable across Windows and Linux, configure local startup, normalize Windows static asset paths, and fix test fixture cleanup and file URL handling. Exclude local environment settings, databases, dependencies, validation output, and TypeScript build cache from version control. Validation: npm ci, static and server builds, 106 arrival tests, and actual local HTTP checks passed. The full suite passed 467 of 470 tests; three tests still require QA fixtures omitted from the supplied release, documented in README-서버실행.md.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import { test } from 'node:test';
|
||||
|
||||
const html = await readFile(new URL('../index.html', import.meta.url), 'utf8');
|
||||
const range = id => {
|
||||
const input = html.match(new RegExp(`<input\\b[^>]*\\bid="${id}"[^>]*>`))?.[0];
|
||||
assert.ok(input, `${id} is a real HTML input`);
|
||||
return Object.fromEntries([...input.matchAll(/([\w-]+)="([^"]*)"/g)].map(([, key, value]) => [key, value]));
|
||||
};
|
||||
|
||||
test('photo distance defaults to 16 within the original 0–21 percent range', () => {
|
||||
const input = range('photo-glass-distance');
|
||||
assert.deepEqual([input.type, input.min, input.max, input.step, input.value], ['range', '0', '21', '1', '16']);
|
||||
assert.match(html, /<output id="photoGlassDistanceOut">16%<\/output>/);
|
||||
assert.doesNotMatch(html, /100% 멀어짐/);
|
||||
});
|
||||
|
||||
test('camera offset exposes 0.35–0.90 with the gentler 0.75 default', () => {
|
||||
const input = range('camera-offset');
|
||||
assert.deepEqual([input.type, input.min, input.max, input.step, input.value], ['range', '0.35', '0.90', '0.01', '0.75']);
|
||||
});
|
||||
|
||||
test('curvature offers exactly convex and concave with convex selected', () => {
|
||||
const select = html.match(/<select\b[^>]*\bid="curvature"[^>]*>([\s\S]*?)<\/select>/)?.[1];
|
||||
assert.ok(select, 'curvature is a select rather than a continuous slider');
|
||||
const options = [...select.matchAll(/<option\b([^>]*)>([^<]*)<\/option>/g)];
|
||||
assert.equal(options.length, 2);
|
||||
assert.deepEqual(options.map(([, attrs, label]) => [attrs.match(/value="([^"]+)"/)?.[1], label]), [['1', '볼록'], ['-1', '오목']]);
|
||||
assert.match(options[0][1], /\bselected\b/);
|
||||
assert.doesNotMatch(options[1][1], /\bselected\b/);
|
||||
assert.doesNotMatch(html, /id="curvatureOut"/);
|
||||
});
|
||||
|
||||
test('the gloss slider and its output are removed from the DOM', () => {
|
||||
assert.doesNotMatch(html, /id="gloss-strength"|id="glossOut"/);
|
||||
});
|
||||
Reference in New Issue
Block a user