Fix: still counting to un-flaged event (#1726)

* create failing test

* ensuere all values a reset before calculations
This commit is contained in:
Alex Christoffer Rasmussen
2025-08-14 19:43:04 +02:00
committed by Carlos Valente
parent db922a67e2
commit 0e770655dc
4 changed files with 55 additions and 35 deletions
@@ -30,3 +30,39 @@ test('Rearrange while playing', async ({ page }) => {
// but entry 1 should be the one playing (it will be unlinked as it will be the first event)
await expect(page.getByTestId('entry-1').getByTestId('rundown-event')).toHaveAttribute('data-running');
});
test('flag and unflag an event while playing', async ({ page }) => {
await page.goto('http://localhost:4001/editor/');
await page.getByRole('button', { name: 'Clear all' }).click();
await page.getByRole('button', { name: 'Delete all' }).click();
await page.getByRole('button', { name: 'Create Event' }).click();
await page.getByRole('button', { name: 'Event' }).nth(4).click();
//start the the first event
await page.getByTestId('entry-1').getByRole('button', { name: 'Start event' }).click();
// there should be no flag times
await expect(page.getByTestId('flag-plannedStart')).toContainText('––:––:––');
await expect(page.getByTestId('flag-expectedStart')).toContainText('––:––:––');
// set the flag
await page.getByTestId('entry-2').getByTestId('rundown-event').getByText('2').click({
button: 'right',
});
await page.getByRole('menuitem', { name: 'Add flag' }).click();
// now there should be flag times
await expect(page.getByTestId('flag-plannedStart')).not.toContainText('––:––:––');
await expect(page.getByTestId('flag-expectedStart')).not.toContainText('––:––:––');
// remove the flag again
await page.getByTestId('entry-2').getByTestId('rundown-event').getByText('2').click({
button: 'right',
});
await page.getByRole('menuitem', { name: 'Remove flag' }).click();
// there should be no flag times
await expect(page.getByTestId('flag-plannedStart')).toContainText('––:––:––');
await expect(page.getByTestId('flag-expectedStart')).toContainText('––:––:––');
});