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
+1 -2
View File
@@ -8,8 +8,7 @@ test.describe('pages routes are available', () => {
await page.goto('http://localhost:4001/editor');
await expect(page).toHaveTitle(/ontime/);
// TODO (v3): not ready yet
// await expect(page.getByTestId('editor-container')).toBeVisible();
await expect(page.getByTestId('editor-container')).toBeVisible();
await expect(page.getByTestId('panel-rundown')).toBeVisible();
await expect(page.getByTestId('panel-timer-control')).toBeVisible();
await expect(page.getByTestId('panel-messages-control')).toBeVisible();
+1 -6
View File
@@ -25,12 +25,7 @@ test('test project file upload', async ({ page }) => {
await page.getByPlaceholder('Start').first().click();
await page.getByText('First test event').click();
await page.getByTestId('delay-input').click();
await page
.locator('div')
.filter({ hasText: /^SED\+10 minNew start: 10:10:00$/ })
.getByPlaceholder('Start')
.click();
await page.getByText('+10 minNew start: 10:10:00').click();
await page.getByText('New start: 10:10').click();
await page.getByText('Second test event').click();
await page.getByText('Lunch').click();
await page.getByText('Third test event').click();
+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();
});