diff --git a/scripts/test-content-editor-versions.js b/scripts/test-content-editor-versions.js index 9f09feb..54c0a88 100644 --- a/scripts/test-content-editor-versions.js +++ b/scripts/test-content-editor-versions.js @@ -75,10 +75,11 @@ async function main() { try { // Create two saves → two backups of intermediate states + const runId = Date.now(); const v1 = JSON.parse(original); - v1.hero.subtitle = 'Verzió teszt #1'; + v1.hero.subtitle = 'Verzió teszt #1 ' + runId; const v2 = JSON.parse(original); - v2.hero.subtitle = 'Verzió teszt #2'; + v2.hero.subtitle = 'Verzió teszt #2 ' + runId; for (const variant of [v1, v2]) { const res = await fetch(`${BASE}/save?file=contact`, { @@ -120,7 +121,7 @@ async function main() { const backupHoldingV1 = fs.readdirSync(backupDir) .filter(name => name.startsWith('contact.')) .filter(name => fs.statSync(path.join(backupDir, name)).mtimeMs >= testStartedAt) - .find(name => fs.readFileSync(path.join(backupDir, name), 'utf8').includes('Verzió teszt #1')); + .find(name => fs.readFileSync(path.join(backupDir, name), 'utf8').includes('Verzió teszt #1 ' + runId)); assert.ok(backupHoldingV1, 'seeded backup holding v1 must exist'); const diffPage = await (await fetch(`${BASE}/versions?file=contact&show=${backupHoldingV1}`, { headers: { Cookie: cookie } })).text(); @@ -134,7 +135,7 @@ async function main() { headers: { Cookie: cookie, 'X-CSRF-Token': csrf }, }); assert.equal(restore.status, 200); - assert.ok(fs.readFileSync(contentFile, 'utf8').includes('Verzió teszt #1')); + assert.ok(fs.readFileSync(contentFile, 'utf8').includes('Verzió teszt #1 ' + runId)); // restore created a new backup of the pre-restore state (reversibility) const afterPage = await (await fetch(`${BASE}/versions?file=contact`, { headers: { Cookie: cookie } })).text();