refactor: simplify custom field shape

This commit is contained in:
Carlos Valente
2024-04-16 22:58:46 +02:00
committed by Carlos Valente
parent cf14b0b427
commit c4136a0ec7
15 changed files with 40 additions and 40 deletions
@@ -304,15 +304,15 @@ describe('generate()', () => {
type: SupportedEvent.Event,
id: '1',
custom: {
lighting: { value: 'event 1 lx' },
lighting: 'event 1 lx',
} as EventCustomFields,
} as OntimeEvent,
{
type: SupportedEvent.Event,
id: '2',
custom: {
lighting: { value: 'event 2 lx' },
sound: { value: 'event 2 sound' },
lighting: 'event 2 lx',
sound: 'event 2 sound',
} as EventCustomFields,
} as OntimeEvent,
];
@@ -322,10 +322,10 @@ describe('generate()', () => {
lighting: ['1', '2'],
sound: ['2'],
});
expect((initResult.rundown['1'] as OntimeEvent).custom).toMatchObject({ lighting: { value: 'event 1 lx' } });
expect((initResult.rundown['1'] as OntimeEvent).custom).toMatchObject({ lighting: 'event 1 lx' });
expect((initResult.rundown['2'] as OntimeEvent).custom).toMatchObject({
lighting: { value: 'event 2 lx' },
sound: { value: 'event 2 sound' },
lighting: 'event 2 lx',
sound: 'event 2 sound',
});
});
});