Release v2.5.4

This commit is contained in:
2026-08-03 21:20:54 +01:00
parent a5e8ecb21f
commit a45552fed3
22 changed files with 371 additions and 9 deletions
+52
View File
@@ -0,0 +1,52 @@
const test = require('node:test');
const assert = require('node:assert/strict');
const { createQrCodeSvg, buildQrCodeContent } = require('../src/data/qr-code');
const { buildSlidePayload } = require('../src/data/slides');
test('createQrCodeSvg renders a qr svg for non-empty values', async () => {
const svg = await createQrCodeSvg('https://example.com');
assert.equal(typeof svg, 'string');
assert.match(svg, /^<svg[\s>]/);
});
test('buildQrCodeContent stores qr svg content for qr-code regions', async () => {
const content = await buildQrCodeContent('https://example.com');
assert.equal(content.type, 'qr-code');
assert.equal(content.value, 'https://example.com');
assert.equal(typeof content.qr_svg, 'string');
assert.match(content.qr_svg, /^<svg[\s>]/);
});
test('buildSlidePayload stores qr-code slide content from the submitted url', async () => {
const pool = {
async query(sql) {
if (sql.includes('FROM c_templates st')) {
return [[{ id: 7, name: 'Template 7', canvas_size_id: 1, canvas_size_width: 1920, canvas_size_height: 1080 }]];
}
if (sql.includes('FROM c_template_regions')) {
return [[{ id: 22, template_id: 7, region_key: 'qrRegion', region_type: 'qr-code', label: 'QR' }]];
}
return [[]];
}
};
const payload = await buildSlidePayload(pool, {
body: {
title: 'QR Slide',
template_id: '7',
region_qr_code_22: 'https://example.com'
},
files: []
}, null);
const content = JSON.parse(payload.contentJson);
assert.equal(content.qrRegion.type, 'qr-code');
assert.equal(content.qrRegion.value, 'https://example.com');
assert.equal(typeof content.qrRegion.qr_svg, 'string');
assert.match(content.qrRegion.qr_svg, /^<svg[\s>]/);
});
+25
View File
@@ -0,0 +1,25 @@
const test = require('node:test');
const assert = require('node:assert/strict');
const renderDashboardPage = require('../src/web/routes/signage/dashboard');
test('dashboard onboarding link uses the player base url', () => {
const html = renderDashboardPage(
{
screens: [
{
public_base_url: 'http://player.local/'
}
],
playlists: [],
clients: [],
slides: [],
connectedClientsCount: 0
},
'',
null
);
assert.match(html, /href="http:\/\/player\.local"/);
assert.doesNotMatch(html, /http:\/\/player\.local\//);
});