feat: load unread topics into topbar drawer on open
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const client = fs.readFileSync(path.join(__dirname, '..', 'public', 'client.js'), 'utf8');
|
||||
|
||||
assert(
|
||||
client.includes("'show.bs.dropdown.westgateUnread'"),
|
||||
'client.js should fetch unread topics when the unread dropdown opens'
|
||||
);
|
||||
assert(
|
||||
client.includes("api.get('/unread'"),
|
||||
'client.js should load the unread list from the /unread API'
|
||||
);
|
||||
assert(
|
||||
client.includes('renderUnreadMenu'),
|
||||
'client.js should expose the unread menu renderer'
|
||||
);
|
||||
assert(
|
||||
/textContent/.test(client) && !/innerHTML\s*=[^=]*title/.test(client),
|
||||
'Topic titles must be inserted via textContent, never innerHTML'
|
||||
);
|
||||
Reference in New Issue
Block a user