Show publication time in larger update version message
CI / verify (push) Waiting to run

This commit is contained in:
Sucukdeluxe
2026-09-22 06:25:00 +02:00
parent 4b5a445ae0
commit 8654cda7dc
8 changed files with 34 additions and 2 deletions
+2
View File
@@ -176,6 +176,8 @@ test('English is the fallback language and German remains selectable', () => {
test('translations cover static labels and interpolated status text in both languages', () => {
assert.equal(translateText('Einstellungen', 'en'), 'Settings');
assert.equal(translateText('Update v2.1.0 verfügbar', 'en'), 'Update v2.1.0 available');
assert.equal(translateText('Update v2.1.50 verfügbar (22.09.2026 - 19:30)', 'en'), 'Update v2.1.50 available (22.09.2026 - 19:30)');
assert.equal(translateText('Update v2.1.50 available (22.09.2026 - 19:30)', 'de'), 'Update v2.1.50 verfügbar (22.09.2026 - 19:30)');
assert.equal(translateText('Settings', 'de'), 'Einstellungen');
assert.equal(translateText('Update v2.1.0 available', 'de'), 'Update v2.1.0 verfügbar');
assert.equal(translateText('Alle Status', 'en'), 'Any status');
+15
View File
@@ -5483,6 +5483,21 @@ test('upload sidebar renders and updates the remaining upload size', () => {
assert.match(appSource, /_setUploadTelemetryText\(['"]uploadTelemetryRemainingSize['"],\s*formatBytes\(stats\.bytesRemaining\)\)/u);
});
test('update publication dates use local time and omit missing or invalid metadata', () => {
const vm = require('node:vm');
const source = fs.readFileSync(path.join(__dirname, '../renderer/app.js'), 'utf8');
const formatter = source.slice(source.indexOf('function formatUpdatePublicationDate('), source.indexOf('function showUpdateBanner('));
const context = vm.createContext({});
vm.runInContext(formatter, context);
assert.equal(vm.runInContext("formatUpdatePublicationDate('2026-09-22T19:30:00')", context), '22.09.2026 - 19:30');
for (const value of [null, undefined, '', 'invalid']) {
context.value = value;
assert.equal(vm.runInContext('formatUpdatePublicationDate(value)', context), '');
}
const css = fs.readFileSync(path.join(__dirname, '../renderer/styles.css'), 'utf8');
assert.match(css, /\.update-dialog-copy p\s*\{[^}]*font-size:\s*14px;/su);
});
test('header occupies its final geometry before asynchronous initialization', () => {
const projectRoot = path.join(__dirname, '..');
const html = fs.readFileSync(path.join(projectRoot, 'renderer', 'index.html'), 'utf8');
+2
View File
@@ -231,6 +231,7 @@ test('update preparation refreshes a cached release before downloading the insta
name: `Multi-Hoster-Upload v${version}`,
tag_name: `v${version}`,
html_url: `https://update.invalid/releases/${version}`,
published_at: '2026-09-22T17:30:00Z',
body: `Release ${version}`,
assets: [
{
@@ -288,6 +289,7 @@ test('update preparation refreshes a cached release before downloading the insta
};
const oldCheck = await isolatedUpdater.checkForUpdate();
assert.equal(oldCheck.remoteVersion, oldVersion);
assert.equal(oldCheck.publishedAt, '2026-09-22T17:30:00Z');
global.fetch = async url => {
const value = String(url);