refactor: update timers (#729)

* refactor: remove duplication

* refactor: previous times

* refactor: event patching
This commit is contained in:
Carlos Valente
2024-01-25 13:36:45 +01:00
committed by GitHub
parent e748bff0dd
commit 74e1ae609c
32 changed files with 448 additions and 555 deletions
+5 -5
View File
@@ -25,11 +25,11 @@ test('delay blocks add time to events', async ({ page }) => {
await page.getByTestId('delay-input').click();
await page.getByTestId('delay-input').fill('2m');
await page.getByTestId('delay-input').press('Enter');
await page.getByText('+2 minNew start: 00:12:00').click();
await page.getByText('New start: 00:12').click();
// make negative delay
await page.getByText('Subtract time').click();
await page.getByText('-2 minNew start: 00:08:00').click();
await page.getByText('New start: 00:08').click();
// apply delay
await page.getByRole('button', { name: 'Apply' }).click();
@@ -42,12 +42,12 @@ test('delay blocks add time to events', async ({ page }) => {
await page.getByTestId('delay-input').click();
await page.getByTestId('delay-input').fill('10m');
await page.getByTestId('delay-input').press('Enter');
await page.getByText('+10 minNew start: 00:18:00').click();
await page.getByText('New start: 00:18').click();
// cancel delay
await page.getByRole('button', { name: 'Cancel' }).click();
await expect(page.getByTestId('rundown').getByTestId('time-input-timeStart')).toHaveValue('00:08:00');
await expect(page.getByText('+10 minNew start: 00:18:00')).toHaveCount(0);
await expect(page.getByText('New start: 00:18')).toHaveCount(0);
});
test('delays are show correctly', async ({ page }) => {
@@ -79,7 +79,7 @@ test('delays are show correctly', async ({ page }) => {
await page.getByTestId('delay-input').press('Enter');
// delay is shown in the editor
await page.getByText('+1 minNew start: 00:11:00').click();
await page.getByText('New start: 00:11').click();
// delay is shown in the cuesheet
await page.goto('http://localhost:4001/cuesheet');
+2 -2
View File
@@ -1,4 +1,4 @@
import { test, expect } from '@playwright/test';
import { test } from '@playwright/test';
test('test aliases feature, it should redirect to given alias', async ({ page }) => {
await page.goto('http://localhost:4001/editor');
@@ -17,5 +17,5 @@ test('test aliases feature, it should redirect to given alias', async ({ page })
// make sure alias works
await page.goto('http://localhost:4001/testing');
await page.getByText('Select an event to follow').click();
await page.getByTestId('countdown__select').click();
});