Reworked watcher events and describing texts
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
import test from 'node:test';
|
||||
|
||||
const root = path.resolve(import.meta.dirname, '..');
|
||||
|
||||
async function read(relativePath) {
|
||||
return fs.readFile(path.join(root, relativePath), 'utf8');
|
||||
}
|
||||
|
||||
test('start page keeps nearby recommendations and the complete route list', async () => {
|
||||
const html = await read('public/index.html');
|
||||
const app = await read('public/js/app.js');
|
||||
|
||||
assert.match(html, /id="nearby-route-list"/);
|
||||
assert.match(html, /id="all-route-list"/);
|
||||
assert.match(html, /id="route-search"/);
|
||||
assert.match(app, /renderRouteItems\('#nearby-route-list'/);
|
||||
assert.match(app, /renderRouteItems\(\s*'#all-route-list'/);
|
||||
assert.doesNotMatch(app, /state\.routes\s*=\s*state\.routes[\s\S]*?\.filter\(route => route\.proximityM/);
|
||||
});
|
||||
Reference in New Issue
Block a user