Release 2.7.4
Publish Docker Image / build-and-push (./build/Dockerfile, git.lzstealth.com/lzstealth/pulse-signage-web, web) (push) Successful in 1m15s
Publish Docker Image / build-and-push (./build/Dockerfile.player, git.lzstealth.com/lzstealth/pulse-signage-player, player) (push) Successful in 32s
Publish Docker Image / build-and-push (./build/Dockerfile, git.lzstealth.com/lzstealth/pulse-signage-web, web) (push) Successful in 1m15s
Publish Docker Image / build-and-push (./build/Dockerfile.player, git.lzstealth.com/lzstealth/pulse-signage-player, player) (push) Successful in 32s
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
|
||||
require('../src/common');
|
||||
|
||||
const pages = require('../src/web/pages');
|
||||
const registerAboutRoutes = require('../src/web/routes/settings/about/routes');
|
||||
|
||||
test('about page renders the footer link beside the version and lists bundled libraries', () => {
|
||||
const html = pages.renderAboutPage({ id: 1 });
|
||||
|
||||
const orderedNames = ['AdminLTE', 'Animate.css', 'Bootstrap Icons', 'Cropper.js', 'Express', 'Handlebars', 'hls.js', 'Multer', 'MySQL2', 'Sharp', 'TinyMCE', 'ws'];
|
||||
let previousIndex = -1;
|
||||
|
||||
orderedNames.forEach(function (name) {
|
||||
const currentIndex = html.indexOf(name);
|
||||
assert.ok(currentIndex >= 0, `missing ${name}`);
|
||||
assert.ok(currentIndex > previousIndex, `${name} is out of order`);
|
||||
previousIndex = currentIndex;
|
||||
});
|
||||
|
||||
assert.match(html, /v2\.7\.4/);
|
||||
assert.match(html, /About Pulse/);
|
||||
assert.match(html, /href="\/settings\/about"/);
|
||||
assert.match(html, /Cropper\.js/);
|
||||
assert.match(html, /TinyMCE/);
|
||||
assert.match(html, /7\.7\.0/);
|
||||
assert.match(html, /card card-outline card-primary h-100 overflow-hidden/);
|
||||
assert.doesNotMatch(html, /rounded-3 overflow-hidden border/);
|
||||
});
|
||||
|
||||
test('about route sends the about page', async () => {
|
||||
const handlers = {};
|
||||
const app = {
|
||||
get(path, ...routeHandlers) {
|
||||
handlers[path] = routeHandlers;
|
||||
}
|
||||
};
|
||||
|
||||
registerAboutRoutes(app, {
|
||||
pages: {
|
||||
renderAboutPage(currentUser) {
|
||||
return currentUser && currentUser.id === 7 ? 'about-page' : 'unexpected';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const response = {
|
||||
body: null,
|
||||
send(value) {
|
||||
this.body = value;
|
||||
return this;
|
||||
}
|
||||
};
|
||||
|
||||
await handlers['/settings/about'][0]({ currentUser: { id: 7 } }, response, function () {});
|
||||
|
||||
assert.equal(response.body, 'about-page');
|
||||
});
|
||||
Reference in New Issue
Block a user