-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add projects detail page, task create / delete
- Loading branch information
Showing
32 changed files
with
740 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import { expect, Page } from '@playwright/test'; | ||
import { PLAYWRIGHT_BASE_URL } from '../playwright/config'; | ||
import { test } from '../playwright/fixtures'; | ||
|
||
async function goToProjectsOverview(page: Page) { | ||
await page.goto(PLAYWRIGHT_BASE_URL + '/projects'); | ||
} | ||
|
||
// Create new project via modal | ||
test('test that creating and deleting a new tag in a new project works', async ({ | ||
page, | ||
}) => { | ||
const newProjectName = | ||
'New Project ' + Math.floor(1 + Math.random() * 10000); | ||
await goToProjectsOverview(page); | ||
await page.getByRole('button', { name: 'Create Project' }).click(); | ||
await page.getByPlaceholder('Project Name').fill(newProjectName); | ||
await Promise.all([ | ||
page.getByRole('button', { name: 'Create Project' }).nth(1).click(), | ||
page.waitForResponse( | ||
async (response) => | ||
response.url().includes('/projects') && | ||
response.request().method() === 'POST' && | ||
response.status() === 201 && | ||
(await response.json()).data.id !== null && | ||
(await response.json()).data.color !== null && | ||
(await response.json()).data.client_id === null && | ||
(await response.json()).data.name === newProjectName | ||
), | ||
]); | ||
|
||
await expect(page.getByTestId('project_table')).toContainText( | ||
newProjectName | ||
); | ||
|
||
await page.getByText(newProjectName).click(); | ||
|
||
const newTaskName = 'New Project ' + Math.floor(1 + Math.random() * 10000); | ||
|
||
await page.getByRole('button', { name: 'Create Task' }).click(); | ||
await page.getByPlaceholder('Task Name').fill(newTaskName); | ||
|
||
await Promise.all([ | ||
page.getByRole('button', { name: 'Create Task' }).nth(1).click(), | ||
page.waitForResponse( | ||
async (response) => | ||
response.url().includes('/tasks') && | ||
response.request().method() === 'POST' && | ||
response.status() === 201 && | ||
(await response.json()).data.id !== null && | ||
(await response.json()).data.project_id !== null && | ||
(await response.json()).data.name === newTaskName | ||
), | ||
]); | ||
|
||
await expect(page.getByTestId('task_table')).toContainText(newTaskName); | ||
|
||
const taskMoreButton = page.locator( | ||
"[aria-label='Actions for Task " + newTaskName + "']" | ||
); | ||
taskMoreButton.click(); | ||
const taskDeleteButton = page.locator( | ||
"[aria-label='Delete Task " + newTaskName + "']" | ||
); | ||
|
||
await Promise.all([ | ||
taskDeleteButton.click(), | ||
page.waitForResponse( | ||
async (response) => | ||
response.url().includes('/tasks') && | ||
response.request().method() === 'DELETE' && | ||
response.status() === 204 | ||
), | ||
]); | ||
await expect(page.getByTestId('task_table')).not.toContainText(newTaskName); | ||
|
||
await goToProjectsOverview(page); | ||
|
||
const moreButton = page.locator( | ||
"[aria-label='Actions for Project " + newProjectName + "']" | ||
); | ||
moreButton.click(); | ||
const deleteButton = page.locator( | ||
"[aria-label='Delete Project " + newProjectName + "']" | ||
); | ||
|
||
await Promise.all([ | ||
deleteButton.click(), | ||
page.waitForResponse( | ||
async (response) => | ||
response.url().includes('/projects') && | ||
response.request().method() === 'DELETE' && | ||
response.status() === 204 | ||
), | ||
]); | ||
await expect(page.getByTestId('project_table')).not.toContainText( | ||
newProjectName | ||
); | ||
}); | ||
|
||
// Create new project with new Client | ||
|
||
// Create new project with existing Client | ||
|
||
// Delete project via More Options | ||
|
||
// Test that project task count is displayed correctly | ||
|
||
// Test that active / archive / all filter works (once implemented) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 15 additions & 13 deletions
28
resources/js/Components/Common/Client/ClientTableHeading.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
<script setup lang="ts"></script> | ||
<script setup lang="ts"> | ||
import TableHeading from '@/Components/Common/TableHeading.vue'; | ||
</script> | ||
|
||
<template> | ||
<div | ||
class="py-1.5 pr-3 text-left text-sm font-semibold text-white pl-4 sm:pl-6 lg:pl-8 3xl:pl-12 bg-row-heading-background border-t border-row-heading-border"> | ||
Name | ||
</div> | ||
<div | ||
class="px-3 py-1.5 text-left text-sm font-semibold text-white bg-row-heading-background"> | ||
Status | ||
</div> | ||
<div | ||
class="relative py-1.5 pl-3 pr-4 sm:pr-6 lg:pr-8 3xl:pr-12 bg-row-heading-background"> | ||
<span class="sr-only">Edit</span> | ||
</div> | ||
<TableHeading> | ||
<div | ||
class="py-1.5 pr-3 text-left text-sm font-semibold text-white pl-4 sm:pl-6 lg:pl-8 3xl:pl-12"> | ||
Name | ||
</div> | ||
<div class="px-3 py-1.5 text-left text-sm font-semibold text-white"> | ||
Status | ||
</div> | ||
<div class="relative py-1.5 pl-3 pr-4 sm:pr-6 lg:pr-8 3xl:pr-12"> | ||
<span class="sr-only">Edit</span> | ||
</div> | ||
</TableHeading> | ||
</template> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 25 additions & 25 deletions
50
resources/js/Components/Common/Member/MemberTableHeading.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
<script setup lang="ts"></script> | ||
<script setup lang="ts"> | ||
import TableHeading from '@/Components/Common/TableHeading.vue'; | ||
</script> | ||
|
||
<template> | ||
<div | ||
class="py-1.5 pr-3 text-left text-sm font-semibold text-white pl-4 sm:pl-6 lg:pl-8 3xl:pl-12 bg-row-heading-background border-t border-row-heading-border"> | ||
Name | ||
</div> | ||
<div | ||
class="px-3 py-1.5 text-left text-sm font-semibold text-white bg-row-heading-background"> | ||
</div> | ||
<div | ||
class="px-3 py-1.5 text-left text-sm font-semibold text-white bg-row-heading-background"> | ||
Role | ||
</div> | ||
<div | ||
class="px-3 py-1.5 text-left text-sm font-semibold text-white bg-row-heading-background"> | ||
Billable Rate | ||
</div> | ||
<div | ||
class="px-3 py-1.5 text-left text-sm font-semibold text-white bg-row-heading-background"> | ||
Status | ||
</div> | ||
<div | ||
class="relative py-1.5 pl-3 pr-4 sm:pr-6 lg:pr-8 3xl:pr-12 bg-row-heading-background"> | ||
<span class="sr-only">Edit</span> | ||
</div> | ||
<TableHeading> | ||
<div | ||
class="py-1.5 pr-3 text-left text-sm font-semibold text-white pl-4 sm:pl-6 lg:pl-8 3xl:pl-12"> | ||
Name | ||
</div> | ||
<div class="px-3 py-1.5 text-left text-sm font-semibold text-white"> | ||
</div> | ||
<div class="px-3 py-1.5 text-left text-sm font-semibold text-white"> | ||
Role | ||
</div> | ||
<div class="px-3 py-1.5 text-left text-sm font-semibold text-white"> | ||
Billable Rate | ||
</div> | ||
<div class="px-3 py-1.5 text-left text-sm font-semibold text-white"> | ||
Status | ||
</div> | ||
<div | ||
class="relative py-1.5 pl-3 pr-4 sm:pr-6 lg:pr-8 3xl:pr-12 bg-row-heading-background"> | ||
<span class="sr-only">Edit</span> | ||
</div> | ||
</TableHeading> | ||
</template> | ||
|
||
<style scoped></style> |
Oops, something went wrong.