Release 0.5.9
This commit is contained in:
1 parent
2851c7d936
commit
c3033479b5
32 files changed
+1598
-50
No files matched your search
@@ -464,6 +464,72 @@ describe('show builder data layer', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('keeps private source, tool and topic snapshots stable until an explicit refresh', () => {
|
||||
const database = getDatabase();
|
||||
database
|
||||
.prepare(
|
||||
`INSERT INTO tools (id, name, start_url, description, is_active, created_at_utc, updated_at_utc)
|
||||
VALUES ('tool-tierlist', 'Tierlist', 'https://example.com/start', '', 1, ?, ?)`
|
||||
)
|
||||
.run('2026-10-23T00:00:00.000Z', '2026-10-23T00:00:00.000Z');
|
||||
database
|
||||
.prepare(
|
||||
`INSERT INTO piece_tools (id, piece_id, tool_id, work_url, note, position)
|
||||
VALUES ('piece-tool-console', 'piece-console', 'tool-tierlist', 'https://example.com/board', 'Erster Stand', 0)`
|
||||
)
|
||||
.run();
|
||||
const show = createShow({ title: 'Relationen', startsAtUtc: null, templateId: null });
|
||||
const section = addShowSection(show.id, show.revision, {
|
||||
name: 'Block',
|
||||
categoryId: null,
|
||||
explicitDurationSeconds: null
|
||||
});
|
||||
const added = addPieceUsage(show.id, section.revision, {
|
||||
pieceId: 'piece-console',
|
||||
sectionId: section.id
|
||||
});
|
||||
let usage = getShow(show.id)!.sections[0].usages[0];
|
||||
expect(usage).toMatchObject({
|
||||
sources: [{ label: 'Herstellerseite', url: 'https://example.com/console' }],
|
||||
tools: [{ name: 'Tierlist', workUrl: 'https://example.com/board', note: 'Erster Stand' }],
|
||||
topics: ['Gaming']
|
||||
});
|
||||
|
||||
database
|
||||
.prepare("UPDATE piece_sources SET label = 'Neue Quelle' WHERE piece_id = 'piece-console'")
|
||||
.run();
|
||||
database
|
||||
.prepare("UPDATE tools SET name = 'Neuer Katalogname' WHERE id = 'tool-tierlist'")
|
||||
.run();
|
||||
database
|
||||
.prepare(
|
||||
"UPDATE piece_tools SET work_url = 'https://example.com/new' WHERE id = 'piece-tool-console'"
|
||||
)
|
||||
.run();
|
||||
database.prepare("DELETE FROM piece_topics WHERE piece_id = 'piece-console'").run();
|
||||
database
|
||||
.prepare(
|
||||
"INSERT INTO piece_topics (piece_id, topic_id) VALUES ('piece-console', 'topic-internet')"
|
||||
)
|
||||
.run();
|
||||
usage = getShow(show.id)!.sections[0].usages[0];
|
||||
expect(usage.sources[0].label).toBe('Herstellerseite');
|
||||
expect(usage.tools[0]).toMatchObject({
|
||||
name: 'Tierlist',
|
||||
workUrl: 'https://example.com/board'
|
||||
});
|
||||
expect(usage.topics).toEqual(['Gaming']);
|
||||
|
||||
refreshPieceUsageFromOriginal(show.id, usage.id, added.revision);
|
||||
usage = getShow(show.id)!.sections[0].usages[0];
|
||||
expect(usage.sources[0].label).toBe('Neue Quelle');
|
||||
expect(usage.tools[0]).toMatchObject({
|
||||
name: 'Neuer Katalogname',
|
||||
workUrl: 'https://example.com/new'
|
||||
});
|
||||
expect(usage.topics).toEqual(['Netzkultur']);
|
||||
});
|
||||
|
||||
it('persists normalized section and usage reordering, moving and removal', () => {
|
||||
const created = createShow({ title: 'Sortierung', startsAtUtc: null, templateId: null });
|
||||
const firstSection = addShowSection(created.id, created.revision, {
|
||||
|
||||
Reference in new issue
Block a user