// Every page we serve carries the same cube as favicon and mark; the notepad's cube has ruled lines on its left face. // node tests/modules/logo_test.js const fs = require('fs'); const root = __dirname + '/../../'; const base = ""; let failed = 0; const ok = (n, v) => { console.log(v ? 'ok ' : 'FAIL', n); if (!v) failed++; }; const pages = ['web/static/index.html', 'web/static/chat.html', 'web/static/notepad.html', 'web/static/note.html', 'web/static/studio.html', 'web/static/chess/index.html', 'web/private/modules-ai.html']; for (const p of pages) { const h = fs.readFileSync(root + p, 'utf8'); const cubes = h.split(base).length - 1; ok(p + ' has the cube as a mark', cubes >= 1); ok(p + ' has a favicon', /rel="icon"/.test(h)); ok(p + (p.endsWith('notepad.html') ? ' has ruled lines on its cube' : ' has no ruled lines (those are the notepad\'s)'), p.endsWith('notepad.html') ? /stroke-linecap/.test(h) : !/stroke-linecap/.test(h)); } const comfy = fs.readFileSync(root + 'cmd/wxch-server/comfy.go', 'utf8'); ok('the comfy pages carry the cube too', comfy.includes('rel="icon"') && comfy.includes('