restructure timetracker tests to use promise all (#7)

* restructure timetracker tests to use promise all

* remove unused variables & lint

---------

Co-authored-by: Gregor Vostrak <gregorvostrak@Gregors-MacBook-Pro.local>
This commit is contained in:
Gregor Vostrak
2024-03-13 19:44:25 +01:00
committed by GitHub
parent aaed43b697
commit 7cc686f230
12 changed files with 346 additions and 318 deletions

View File

@@ -95,7 +95,7 @@ services:
- sail - sail
- reverse-proxy - reverse-proxy
playwright: playwright:
image: mcr.microsoft.com/playwright:v1.41.1-jammy image: mcr.microsoft.com/playwright:v1.42.1-jammy
command: ['npx', 'playwright', 'test', '--ui-port=8080', '--ui-host=0.0.0.0'] command: ['npx', 'playwright', 'test', '--ui-port=8080', '--ui-host=0.0.0.0']
working_dir: /src working_dir: /src
extra_hosts: extra_hosts:

View File

@@ -17,8 +17,8 @@ async function assertThatTimerHasStarted(page) {
); );
} }
async function assertNewTimeEntryResponse(page) { function newTimeEntryResponse(page) {
await page.waitForResponse(async (response) => { return page.waitForResponse(async (response) => {
return ( return (
response.status() === 201 && response.status() === 201 &&
(await response.headerValue('Content-Type')) === (await response.headerValue('Content-Type')) ===
@@ -37,7 +37,7 @@ async function assertNewTimeEntryResponse(page) {
}); });
} }
async function assertThatTimerIsStoped(page) { async function assertThatTimerIsStopped(page) {
await page.locator( await page.locator(
'[data-testid="dashboard_timer"] [data-testid="timer_button"].bg-accent-300/70' '[data-testid="dashboard_timer"] [data-testid="timer_button"].bg-accent-300/70'
); );
@@ -47,29 +47,32 @@ test('test that starting and stopping a timer without description and project wo
page, page,
}) => { }) => {
await goToDashboard(page); await goToDashboard(page);
const newTimeEntryPromise = newTimeEntryResponse(page);
await startOrStopTimerWithButton(page); await startOrStopTimerWithButton(page);
await assertNewTimeEntryResponse(page); await newTimeEntryPromise;
await assertThatTimerHasStarted(page); await assertThatTimerHasStarted(page);
await page.waitForTimeout(1500); await page.waitForTimeout(1500);
await startOrStopTimerWithButton(page); await Promise.all([
await page.waitForResponse(async (response) => { page.waitForResponse(async (response) => {
return ( return (
response.status() === 200 && response.status() === 200 &&
(await response.headerValue('Content-Type')) === (await response.headerValue('Content-Type')) ===
'application/json' && 'application/json' &&
(await response.json()).data.id !== null && (await response.json()).data.id !== null &&
(await response.json()).data.start !== null && (await response.json()).data.start !== null &&
(await response.json()).data.end !== null && (await response.json()).data.end !== null &&
(await response.json()).data.project_id === null && (await response.json()).data.project_id === null &&
(await response.json()).data.description === '' && (await response.json()).data.description === '' &&
(await response.json()).data.task_id === null && (await response.json()).data.task_id === null &&
(await response.json()).data.duration !== null && (await response.json()).data.duration !== null &&
(await response.json()).data.user_id !== null && (await response.json()).data.user_id !== null &&
JSON.stringify((await response.json()).data.tags) === JSON.stringify((await response.json()).data.tags) ===
JSON.stringify([]) JSON.stringify([])
); );
}); }),
await assertThatTimerIsStoped(page); startOrStopTimerWithButton(page),
]);
await assertThatTimerIsStopped(page);
}); });
test('test that starting and stopping a timer with a description works', async ({ test('test that starting and stopping a timer with a description works', async ({
@@ -79,226 +82,251 @@ test('test that starting and stopping a timer with a description works', async (
await page await page
.getByTestId('time_entry_description') .getByTestId('time_entry_description')
.fill('New Time Entry Description'); .fill('New Time Entry Description');
await startOrStopTimerWithButton(page); await Promise.all([
await page.waitForResponse(async (response) => { page.waitForResponse(async (response) => {
return ( return (
response.status() === 201 && response.status() === 201 &&
(await response.headerValue('Content-Type')) === (await response.headerValue('Content-Type')) ===
'application/json' && 'application/json' &&
(await response.json()).data.id !== null && (await response.json()).data.id !== null &&
(await response.json()).data.start !== null && (await response.json()).data.start !== null &&
(await response.json()).data.end === null && (await response.json()).data.end === null &&
(await response.json()).data.project_id === null && (await response.json()).data.project_id === null &&
(await response.json()).data.description === (await response.json()).data.description ===
'New Time Entry Description' && 'New Time Entry Description' &&
(await response.json()).data.task_id === null && (await response.json()).data.task_id === null &&
(await response.json()).data.duration === null && (await response.json()).data.duration === null &&
(await response.json()).data.user_id !== null && (await response.json()).data.user_id !== null &&
JSON.stringify((await response.json()).data.tags) === JSON.stringify((await response.json()).data.tags) ===
JSON.stringify([]) JSON.stringify([])
); );
}); }),
startOrStopTimerWithButton(page),
]);
await assertThatTimerHasStarted(page); await assertThatTimerHasStarted(page);
await page.waitForTimeout(500); await page.waitForTimeout(1500);
await startOrStopTimerWithButton(page); await Promise.all([
await page.waitForResponse(async (response) => { page.waitForResponse(async (response) => {
return ( return (
response.status() === 200 && response.status() === 200 &&
(await response.headerValue('Content-Type')) === (await response.headerValue('Content-Type')) ===
'application/json' && 'application/json' &&
(await response.json()).data.id !== null && (await response.json()).data.id !== null &&
(await response.json()).data.start !== null && (await response.json()).data.start !== null &&
(await response.json()).data.end !== null && (await response.json()).data.end !== null &&
(await response.json()).data.project_id === null && (await response.json()).data.project_id === null &&
(await response.json()).data.description === (await response.json()).data.description ===
'New Time Entry Description' && 'New Time Entry Description' &&
(await response.json()).data.task_id === null && (await response.json()).data.task_id === null &&
(await response.json()).data.duration !== null && (await response.json()).data.duration !== null &&
(await response.json()).data.user_id !== null && (await response.json()).data.user_id !== null &&
JSON.stringify((await response.json()).data.tags) === JSON.stringify((await response.json()).data.tags) ===
JSON.stringify([]) JSON.stringify([])
); );
}); }),
await assertThatTimerIsStoped(page); await startOrStopTimerWithButton(page),
]);
await assertThatTimerIsStopped(page);
}); });
test('test that starting and updating the description while running works', async ({ test('test that starting and updating the description while running works', async ({
page, page,
}) => { }) => {
await goToDashboard(page); await goToDashboard(page);
await startOrStopTimerWithButton(page);
await page.waitForResponse(async (response) => { await Promise.all([
return ( page.waitForResponse(async (response) => {
response.status() === 201 && return (
(await response.headerValue('Content-Type')) === response.status() === 201 &&
'application/json' && (await response.headerValue('Content-Type')) ===
(await response.json()).data.id !== null && 'application/json' &&
(await response.json()).data.start !== null && (await response.json()).data.id !== null &&
(await response.json()).data.end === null && (await response.json()).data.start !== null &&
(await response.json()).data.project_id === null && (await response.json()).data.end === null &&
(await response.json()).data.description === '' && (await response.json()).data.project_id === null &&
(await response.json()).data.task_id === null && (await response.json()).data.description === '' &&
(await response.json()).data.duration === null && (await response.json()).data.task_id === null &&
(await response.json()).data.user_id !== null && (await response.json()).data.duration === null &&
JSON.stringify((await response.json()).data.tags) === (await response.json()).data.user_id !== null &&
JSON.stringify([]) JSON.stringify((await response.json()).data.tags) ===
); JSON.stringify([])
}); );
}),
startOrStopTimerWithButton(page),
]);
await assertThatTimerHasStarted(page); await assertThatTimerHasStarted(page);
await page.waitForTimeout(500); await page.waitForTimeout(500);
await page await page
.getByTestId('time_entry_description') .getByTestId('time_entry_description')
.fill('New Time Entry Description'); .fill('New Time Entry Description');
await page.getByTestId('time_entry_description').press('Tab');
await page.waitForResponse(async (response) => { await Promise.all([
return ( page.waitForResponse(async (response) => {
response.status() === 200 && return (
(await response.headerValue('Content-Type')) === response.status() === 200 &&
'application/json' && (await response.headerValue('Content-Type')) ===
(await response.json()).data.id !== null && 'application/json' &&
(await response.json()).data.start !== null && (await response.json()).data.id !== null &&
(await response.json()).data.end === null && (await response.json()).data.start !== null &&
(await response.json()).data.project_id === null && (await response.json()).data.end === null &&
(await response.json()).data.description === (await response.json()).data.project_id === null &&
'New Time Entry Description' && (await response.json()).data.description ===
(await response.json()).data.task_id === null && 'New Time Entry Description' &&
(await response.json()).data.duration === null && (await response.json()).data.task_id === null &&
(await response.json()).data.user_id !== null && (await response.json()).data.duration === null &&
JSON.stringify((await response.json()).data.tags) === (await response.json()).data.user_id !== null &&
JSON.stringify([]) JSON.stringify((await response.json()).data.tags) ===
); JSON.stringify([])
}); );
}),
page.getByTestId('time_entry_description').press('Tab'),
]);
await page.waitForTimeout(500); await page.waitForTimeout(500);
await startOrStopTimerWithButton(page); await Promise.all([
await page.waitForResponse(async (response) => { page.waitForResponse(async (response) => {
return ( return (
response.status() === 200 && response.status() === 200 &&
(await response.headerValue('Content-Type')) === (await response.headerValue('Content-Type')) ===
'application/json' && 'application/json' &&
(await response.json()).data.id !== null && (await response.json()).data.id !== null &&
(await response.json()).data.start !== null && (await response.json()).data.start !== null &&
(await response.json()).data.end !== null && (await response.json()).data.end !== null &&
(await response.json()).data.project_id === null && (await response.json()).data.project_id === null &&
(await response.json()).data.description === (await response.json()).data.description ===
'New Time Entry Description' && 'New Time Entry Description' &&
(await response.json()).data.task_id === null && (await response.json()).data.task_id === null &&
(await response.json()).data.duration !== null && (await response.json()).data.duration !== null &&
(await response.json()).data.user_id !== null && (await response.json()).data.user_id !== null &&
JSON.stringify((await response.json()).data.tags) === JSON.stringify((await response.json()).data.tags) ===
JSON.stringify([]) JSON.stringify([])
); );
}); }),
await assertThatTimerIsStoped(page); await startOrStopTimerWithButton(page),
]);
await assertThatTimerIsStopped(page);
}); });
test('test that starting and updating the time while running works', async ({ test('test that starting and updating the time while running works', async ({
page, page,
}) => { }) => {
await goToDashboard(page); await goToDashboard(page);
await startOrStopTimerWithButton(page); const [createResponse] = await Promise.all([
const createResponse = await page.waitForResponse(async (response) => { page.waitForResponse(async (response) => {
return ( return (
response.status() === 201 && response.status() === 201 &&
(await response.headerValue('Content-Type')) === (await response.headerValue('Content-Type')) ===
'application/json' && 'application/json' &&
(await response.json()).data.id !== null && (await response.json()).data.id !== null &&
(await response.json()).data.start !== null && (await response.json()).data.start !== null &&
(await response.json()).data.end === null && (await response.json()).data.end === null &&
(await response.json()).data.project_id === null && (await response.json()).data.project_id === null &&
(await response.json()).data.description === '' && (await response.json()).data.description === '' &&
(await response.json()).data.task_id === null && (await response.json()).data.task_id === null &&
(await response.json()).data.duration === null && (await response.json()).data.duration === null &&
(await response.json()).data.user_id !== null && (await response.json()).data.user_id !== null &&
JSON.stringify((await response.json()).data.tags) === JSON.stringify((await response.json()).data.tags) ===
JSON.stringify([]) JSON.stringify([])
); );
}); }),
await startOrStopTimerWithButton(page),
]);
await assertThatTimerHasStarted(page); await assertThatTimerHasStarted(page);
await page.waitForTimeout(500); await page.waitForTimeout(500);
await page.getByTestId('time_entry_time').fill('20min'); await page.getByTestId('time_entry_time').fill('20min');
await page.getByTestId('time_entry_time').press('Tab');
await page.waitForResponse(async (response) => { await Promise.all([
return ( page.waitForResponse(async (response) => {
response.status() === 200 && return (
(await response.headerValue('Content-Type')) === response.status() === 200 &&
'application/json' && (await response.headerValue('Content-Type')) ===
(await response.json()).data.id !== null && 'application/json' &&
(await response.json()).data.start !== null && (await response.json()).data.id !== null &&
(await response.json()).data.start !== (await response.json()).data.start !== null &&
(await createResponse.json()).data.start && (await response.json()).data.start !==
(await response.json()).data.end === null && (await createResponse.json()).data.start &&
(await response.json()).data.project_id === null && (await response.json()).data.end === null &&
(await response.json()).data.description === '' && (await response.json()).data.project_id === null &&
(await response.json()).data.task_id === null && (await response.json()).data.description === '' &&
(await response.json()).data.duration === null && (await response.json()).data.task_id === null &&
(await response.json()).data.user_id !== null && (await response.json()).data.duration === null &&
JSON.stringify((await response.json()).data.tags) === (await response.json()).data.user_id !== null &&
JSON.stringify([]) JSON.stringify((await response.json()).data.tags) ===
); JSON.stringify([])
}); );
}),
page.getByTestId('time_entry_time').press('Tab'),
]);
await expect(page.getByTestId('time_entry_time')).toHaveValue(/00:20/); await expect(page.getByTestId('time_entry_time')).toHaveValue(/00:20/);
await page.waitForTimeout(500); await page.waitForTimeout(500);
await startOrStopTimerWithButton(page); await Promise.all([
await page.waitForResponse(async (response) => { page.waitForResponse(async (response) => {
return ( return (
response.status() === 200 && response.status() === 200 &&
(await response.headerValue('Content-Type')) === (await response.headerValue('Content-Type')) ===
'application/json' && 'application/json' &&
(await response.json()).data.id !== null && (await response.json()).data.id !== null &&
(await response.json()).data.start !== null && (await response.json()).data.start !== null &&
(await response.json()).data.end !== null && (await response.json()).data.end !== null &&
(await response.json()).data.project_id === null && (await response.json()).data.project_id === null &&
(await response.json()).data.description === '' && (await response.json()).data.description === '' &&
(await response.json()).data.task_id === null && (await response.json()).data.task_id === null &&
(await response.json()).data.duration !== null && (await response.json()).data.duration !== null &&
(await response.json()).data.user_id !== null && (await response.json()).data.user_id !== null &&
JSON.stringify((await response.json()).data.tags) === JSON.stringify((await response.json()).data.tags) ===
JSON.stringify([]) JSON.stringify([])
); );
}); }),
await assertThatTimerIsStoped(page); startOrStopTimerWithButton(page),
]);
await assertThatTimerIsStopped(page);
}); });
test('test that entering a time starts the timer on blur', async ({ page }) => { test('test that entering a time starts the timer on blur', async ({ page }) => {
await goToDashboard(page); await goToDashboard(page);
await page.getByTestId('time_entry_time').fill('20min'); await page.getByTestId('time_entry_time').fill('20min');
await page.getByTestId('time_entry_time').press('Tab'); await Promise.all([
await page.waitForResponse(async (response) => { page.waitForResponse(async (response) => {
return ( return (
response.status() === 201 && response.status() === 201 &&
(await response.headerValue('Content-Type')) === (await response.headerValue('Content-Type')) ===
'application/json' && 'application/json' &&
(await response.json()).data.id !== null && (await response.json()).data.id !== null &&
(await response.json()).data.start !== null && (await response.json()).data.start !== null &&
(await response.json()).data.end === null && (await response.json()).data.end === null &&
(await response.json()).data.project_id === null && (await response.json()).data.project_id === null &&
(await response.json()).data.description === '' && (await response.json()).data.description === '' &&
(await response.json()).data.task_id === null && (await response.json()).data.task_id === null &&
(await response.json()).data.duration === null && (await response.json()).data.duration === null &&
(await response.json()).data.user_id !== null && (await response.json()).data.user_id !== null &&
JSON.stringify((await response.json()).data.tags) === JSON.stringify((await response.json()).data.tags) ===
JSON.stringify([]) JSON.stringify([])
); );
}); }),
page.getByTestId('time_entry_time').press('Tab'),
]);
await assertThatTimerHasStarted(page); await assertThatTimerHasStarted(page);
await startOrStopTimerWithButton(page);
await page.waitForResponse(async (response) => { await Promise.all([
return ( page.waitForResponse(async (response) => {
response.status() === 200 && return (
(await response.headerValue('Content-Type')) === response.status() === 200 &&
'application/json' && (await response.headerValue('Content-Type')) ===
(await response.json()).data.id !== null && 'application/json' &&
(await response.json()).data.start !== null && (await response.json()).data.id !== null &&
(await response.json()).data.end !== null && (await response.json()).data.start !== null &&
(await response.json()).data.project_id === null && (await response.json()).data.end !== null &&
(await response.json()).data.description === '' && (await response.json()).data.project_id === null &&
(await response.json()).data.task_id === null && (await response.json()).data.description === '' &&
(await response.json()).data.duration !== null && (await response.json()).data.task_id === null &&
(await response.json()).data.user_id !== null && (await response.json()).data.duration !== null &&
JSON.stringify((await response.json()).data.tags) === (await response.json()).data.user_id !== null &&
JSON.stringify([]) JSON.stringify((await response.json()).data.tags) ===
); JSON.stringify([])
}); );
}),
startOrStopTimerWithButton(page),
]);
await page.locator( await page.locator(
'[data-testid="dashboard_timer"] [data-testid="timer_button"].bg-accent-300/70' '[data-testid="dashboard_timer"] [data-testid="timer_button"].bg-accent-300/70'
); );
@@ -309,44 +337,48 @@ test('test that entering a time starts the timer on enter', async ({
}) => { }) => {
await goToDashboard(page); await goToDashboard(page);
await page.getByTestId('time_entry_time').fill('20min'); await page.getByTestId('time_entry_time').fill('20min');
await page.getByTestId('time_entry_time').press('Enter'); await Promise.all([
await page.waitForResponse(async (response) => { page.waitForResponse(async (response) => {
return ( return (
response.status() === 201 && response.status() === 201 &&
(await response.headerValue('Content-Type')) === (await response.headerValue('Content-Type')) ===
'application/json' && 'application/json' &&
(await response.json()).data.id !== null && (await response.json()).data.id !== null &&
(await response.json()).data.start !== null && (await response.json()).data.start !== null &&
(await response.json()).data.end === null && (await response.json()).data.end === null &&
(await response.json()).data.project_id === null && (await response.json()).data.project_id === null &&
(await response.json()).data.description === '' && (await response.json()).data.description === '' &&
(await response.json()).data.task_id === null && (await response.json()).data.task_id === null &&
(await response.json()).data.duration === null && (await response.json()).data.duration === null &&
(await response.json()).data.user_id !== null && (await response.json()).data.user_id !== null &&
JSON.stringify((await response.json()).data.tags) === JSON.stringify((await response.json()).data.tags) ===
JSON.stringify([]) JSON.stringify([])
); );
}); }),
page.getByTestId('time_entry_time').press('Enter'),
]);
await assertThatTimerHasStarted(page); await assertThatTimerHasStarted(page);
await startOrStopTimerWithButton(page); await Promise.all([
await page.waitForResponse(async (response) => { page.waitForResponse(async (response) => {
return ( return (
response.status() === 200 && response.status() === 200 &&
(await response.headerValue('Content-Type')) === (await response.headerValue('Content-Type')) ===
'application/json' && 'application/json' &&
(await response.json()).data.id !== null && (await response.json()).data.id !== null &&
(await response.json()).data.start !== null && (await response.json()).data.start !== null &&
(await response.json()).data.end !== null && (await response.json()).data.end !== null &&
(await response.json()).data.project_id === null && (await response.json()).data.project_id === null &&
(await response.json()).data.description === '' && (await response.json()).data.description === '' &&
(await response.json()).data.task_id === null && (await response.json()).data.task_id === null &&
(await response.json()).data.duration !== null && (await response.json()).data.duration !== null &&
(await response.json()).data.user_id !== null && (await response.json()).data.user_id !== null &&
JSON.stringify((await response.json()).data.tags) === JSON.stringify((await response.json()).data.tags) ===
JSON.stringify([]) JSON.stringify([])
); );
}); }),
await assertThatTimerIsStoped(page); startOrStopTimerWithButton(page),
]);
await assertThatTimerIsStopped(page);
}); });
test('test that adding a new tag works', async ({ page }) => { test('test that adding a new tag works', async ({ page }) => {
@@ -354,15 +386,19 @@ test('test that adding a new tag works', async ({ page }) => {
await goToDashboard(page); await goToDashboard(page);
await page.getByTestId('tag_dropdown').click(); await page.getByTestId('tag_dropdown').click();
await page.getByTestId('tag_dropdown_search').fill(newTagName); await page.getByTestId('tag_dropdown_search').fill(newTagName);
await page.getByTestId('tag_dropdown_search').press('Enter');
await page.waitForResponse(async (response) => { await Promise.all([
return ( page.waitForResponse(async (response) => {
response.status() === 201 && return (
(await response.headerValue('Content-Type')) === response.status() === 201 &&
'application/json' && (await response.headerValue('Content-Type')) ===
(await response.json()).data.name === newTagName 'application/json' &&
); (await response.json()).data.name === newTagName
}); );
}),
page.getByTestId('tag_dropdown_search').press('Enter'),
]);
await expect(page.getByTestId('tag_dropdown_search')).toHaveValue(''); await expect(page.getByTestId('tag_dropdown_search')).toHaveValue('');
await expect(page.getByRole('option', { name: newTagName })).toBeVisible(); await expect(page.getByRole('option', { name: newTagName })).toBeVisible();
}); });
@@ -372,24 +408,24 @@ test('test that adding a new tag when the timer is running', async ({
}) => { }) => {
const newTagName = 'New Tag' + Math.floor(Math.random() * 10000); const newTagName = 'New Tag' + Math.floor(Math.random() * 10000);
await goToDashboard(page); await goToDashboard(page);
await startOrStopTimerWithButton(page); await Promise.all([
await assertNewTimeEntryResponse(page); newTimeEntryResponse(page),
startOrStopTimerWithButton(page),
]);
await assertThatTimerHasStarted(page); await assertThatTimerHasStarted(page);
await page.getByTestId('tag_dropdown').click(); await page.getByTestId('tag_dropdown').click();
await page.getByTestId('tag_dropdown_search').fill(newTagName); await page.getByTestId('tag_dropdown_search').fill(newTagName);
await page.getByTestId('tag_dropdown_search').press('Enter'); const [tagCreateResponse] = await Promise.all([
const tagCreateResponse = await page.waitForResponse(async (response) => { page.waitForResponse(async (response) => {
return ( return (
response.status() === 201 && response.status() === 201 &&
(await response.headerValue('Content-Type')) === (await response.headerValue('Content-Type')) ===
'application/json' && 'application/json' &&
(await response.json()).data.name === newTagName (await response.json()).data.name === newTagName
); );
}); }),
await expect(page.getByTestId('tag_dropdown_search')).toHaveValue(''); page.getByTestId('tag_dropdown_search').press('Enter'),
]);
await expect(page.getByRole('option', { name: newTagName })).toBeVisible();
await page.waitForResponse(async (response) => { await page.waitForResponse(async (response) => {
return ( return (
response.status() === 200 && response.status() === 200 &&
@@ -407,27 +443,32 @@ test('test that adding a new tag when the timer is running', async ({
JSON.stringify([(await tagCreateResponse.json()).data.id]) JSON.stringify([(await tagCreateResponse.json()).data.id])
); );
}); });
await expect(page.getByTestId('tag_dropdown_search')).toHaveValue('');
await expect(page.getByRole('option', { name: newTagName })).toBeVisible();
await page.getByTestId('tag_dropdown_search').press('Escape'); await page.getByTestId('tag_dropdown_search').press('Escape');
await page.waitForTimeout(1000); await page.waitForTimeout(1000);
await startOrStopTimerWithButton(page);
await page.waitForResponse(async (response) => { await Promise.all([
return ( page.waitForResponse(async (response) => {
response.status() === 200 && return (
(await response.headerValue('Content-Type')) === response.status() === 200 &&
'application/json' && (await response.headerValue('Content-Type')) ===
(await response.json()).data.id !== null && 'application/json' &&
(await response.json()).data.start !== null && (await response.json()).data.id !== null &&
(await response.json()).data.end !== null && (await response.json()).data.start !== null &&
(await response.json()).data.project_id === null && (await response.json()).data.end !== null &&
(await response.json()).data.description === '' && (await response.json()).data.project_id === null &&
(await response.json()).data.task_id === null && (await response.json()).data.description === '' &&
(await response.json()).data.duration !== null && (await response.json()).data.task_id === null &&
(await response.json()).data.user_id !== null && (await response.json()).data.duration !== null &&
JSON.stringify((await response.json()).data.tags) === (await response.json()).data.user_id !== null &&
JSON.stringify([(await tagCreateResponse.json()).data.id]) JSON.stringify((await response.json()).data.tags) ===
); JSON.stringify([(await tagCreateResponse.json()).data.id])
}); );
await assertThatTimerIsStoped(page); }),
startOrStopTimerWithButton(page),
]);
await assertThatTimerIsStopped(page);
}); });
// test that adding a new tag when the timer is running // test that adding a new tag when the timer is running

View File

@@ -9,7 +9,7 @@ defineProps<{
<template> <template>
<div class="px-4 py-3 grid grid-cols-3"> <div class="px-4 py-3 grid grid-cols-3">
<div class="col-span-2"> <div class="col-span-2">
<p class="font-semibold text-white "> <p class="font-semibold text-white">
{{ name }} {{ name }}
</p> </p>
<div class="text-muted font-medium"> <div class="text-muted font-medium">

View File

@@ -39,8 +39,7 @@ const close = () => {
</div> </div>
</div> </div>
<div <div class="flex flex-row justify-end px-6 py-4 bg-gray-100 text-end">
class="flex flex-row justify-end px-6 py-4 bg-gray-100 text-end">
<slot name="footer" /> <slot name="footer" />
</div> </div>
</Modal> </Modal>

View File

@@ -13,8 +13,7 @@ defineProps<{
<template> <template>
<AppLayout title="API Tokens"> <AppLayout title="API Tokens">
<template #header> <template #header>
<h2 <h2 class="font-semibold text-xl text-white leading-tight">
class="font-semibold text-xl text-white leading-tight">
API Tokens API Tokens
</h2> </h2>
</template> </template>

View File

@@ -34,9 +34,7 @@ const submit = () => {
you to choose a new one. you to choose a new one.
</div> </div>
<div <div v-if="status" class="mb-4 font-medium text-sm text-green-400">
v-if="status"
class="mb-4 font-medium text-sm text-green-400">
{{ status }} {{ status }}
</div> </div>

View File

@@ -38,9 +38,7 @@ const submit = () => {
<AuthenticationCardLogo /> <AuthenticationCardLogo />
</template> </template>
<div <div v-if="status" class="mb-4 font-medium text-sm text-green-400">
v-if="status"
class="mb-4 font-medium text-sm text-green-400">
{{ status }} {{ status }}
</div> </div>

View File

@@ -10,7 +10,7 @@ import type { Organization, User } from '@/types/models';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
import { useProjectsStore } from '@/utils/useProjects'; import { useProjectsStore } from '@/utils/useProjects';
import ActivityGraphCard from '@/Components/Dashboard/ActivityGraphCard.vue'; import ActivityGraphCard from '@/Components/Dashboard/ActivityGraphCard.vue';
import MainContainer from "@/Pages/MainContainer.vue"; import MainContainer from '@/Pages/MainContainer.vue';
const page = usePage<{ const page = usePage<{
auth: { auth: {

View File

@@ -1,6 +1,4 @@
<script setup lang="ts"> <script setup lang="ts"></script>
</script>
<template> <template>
<div class="sm:px-6 lg:px-8 xl:px-12 mx-auto"> <div class="sm:px-6 lg:px-8 xl:px-12 mx-auto">
@@ -8,6 +6,4 @@
</div> </div>
</template> </template>
<style scoped> <style scoped></style>
</style>

View File

@@ -31,8 +31,7 @@ const page = usePage<{
<template> <template>
<AppLayout title="Profile"> <AppLayout title="Profile">
<template #header> <template #header>
<h2 <h2 class="font-semibold text-xl text-white leading-tight">
class="font-semibold text-xl text-white leading-tight">
Profile Profile
</h2> </h2>
</template> </template>

View File

@@ -6,8 +6,7 @@ import CreateTeamForm from '@/Pages/Teams/Partials/CreateTeamForm.vue';
<template> <template>
<AppLayout title="Create Team"> <AppLayout title="Create Team">
<template #header> <template #header>
<h2 <h2 class="font-semibold text-xl text-white leading-tight">
class="font-semibold text-xl text-white leading-tight">
Create Team Create Team
</h2> </h2>
</template> </template>

View File

@@ -17,8 +17,7 @@ defineProps<{
<template> <template>
<AppLayout title="Team Settings"> <AppLayout title="Team Settings">
<template #header> <template #header>
<h2 <h2 class="font-semibold text-xl text-white leading-tight">
class="font-semibold text-xl text-white leading-tight">
Team Settings Team Settings
</h2> </h2>
</template> </template>