mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 10:23:54 +00:00
test: alias feature (#602)
This commit is contained in:
@@ -112,6 +112,7 @@ export default function AliasesForm() {
|
||||
icon={<IoRemove />}
|
||||
colorScheme='red'
|
||||
isDisabled={disableInputs}
|
||||
data-testid={`field__delete_${index}`}
|
||||
/>
|
||||
<Input
|
||||
{...inputProps}
|
||||
@@ -121,6 +122,7 @@ export default function AliasesForm() {
|
||||
variant='ontime-filled-on-light'
|
||||
placeholder='URL Alias'
|
||||
isDisabled={disableInputs}
|
||||
data-testid={`field__alias_${index}`}
|
||||
/>
|
||||
<Input
|
||||
{...inputProps}
|
||||
@@ -130,6 +132,7 @@ export default function AliasesForm() {
|
||||
variant='ontime-filled-on-light'
|
||||
placeholder='URL (portion after ontime Port)'
|
||||
isDisabled={disableInputs}
|
||||
data-testid={`field__url_${index}`}
|
||||
/>
|
||||
<TooltipActionBtn
|
||||
clickHandler={(event) => handleLinks(event, alias.alias)}
|
||||
@@ -140,8 +143,14 @@ export default function AliasesForm() {
|
||||
icon={<IoOpenOutline />}
|
||||
colorScheme='red'
|
||||
isDisabled={disableInputs}
|
||||
data-testid={`field__test_${index}`}
|
||||
/>
|
||||
<Switch
|
||||
{...register(`aliases.${index}.enabled`)}
|
||||
variant='ontime-on-light'
|
||||
isDisabled={disableInputs}
|
||||
data-testid={`field__enable_${index}`}
|
||||
/>
|
||||
<Switch {...register(`aliases.${index}.enabled`)} variant='ontime-on-light' isDisabled={disableInputs} />
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('test aliases feature, it should redirect to given alias', async ({ page }) => {
|
||||
await page.goto('http://localhost:4001/editor');
|
||||
|
||||
// open settings
|
||||
await page.getByRole('button', { name: 'Settings' }).click();
|
||||
await page.getByRole('tab', { name: 'URL Aliases' }).click();
|
||||
|
||||
// create alias
|
||||
await page.getByRole('button', { name: 'Add new' }).click();
|
||||
await page.getByTestId('field__alias_1').fill('testing');
|
||||
await page.getByTestId('field__url_1').fill('countdown');
|
||||
await page.getByTestId('field__enable_1').click();
|
||||
await page.getByRole('button', { name: 'Save', exact: true }).click();
|
||||
await page.getByRole('button', { name: 'Close' }).click();
|
||||
|
||||
// make sure alias works
|
||||
await page.goto('http://localhost:4001/testing');
|
||||
await page.getByText('Select an event to follow').click();
|
||||
});
|
||||
Reference in New Issue
Block a user