24 lines
1.1 KiB
JavaScript
24 lines
1.1 KiB
JavaScript
const assert = require('node:assert/strict');
|
|
const fs = require('node:fs');
|
|
const path = require('node:path');
|
|
const test = require('node:test');
|
|
|
|
const source = fs.readFileSync(path.join(__dirname, '..', 'index.html'), 'utf8');
|
|
|
|
test('player sees an accessible live activity line during world and character proposals', () => {
|
|
assert.match(source, /function setActivityStatus\(message\)/);
|
|
assert.match(source, /setAttribute\('aria-live', 'polite'\)/);
|
|
assert.match(source, /AI ta fram ett förslag på startvärld och en plats/);
|
|
assert.match(source, /AI skapa eller uppdatera ett biografiförslag/);
|
|
});
|
|
|
|
test('dialogue processing explains that scene, place, or person establishment is being considered', () => {
|
|
assert.match(source, /Berättaren arbetar med din avsikt\. Den avgör om en plats, scen eller person behöver etableras/);
|
|
});
|
|
|
|
test('local AI activity is shown separately from general narrator processing', () => {
|
|
assert.match(source, /detail\.type === 'activity' \? 'data-local-ai-activity'/);
|
|
assert.match(source, /Lokal AI: \$\{detail\.text \|\| ''\}/);
|
|
assert.match(source, /clearActivityStatus\(\);/);
|
|
});
|