test: cover project milestone and task modal editors
This commit is contained in:
@@ -52,10 +52,10 @@ test.describe('Task & Comment Flow', () => {
|
||||
|
||||
await page.waitForSelector('button:has-text("+ New")', { timeout: 10000 });
|
||||
await page.click('button:has-text("+ New")');
|
||||
await page.waitForSelector('input[placeholder="Project name"]', { timeout: 10000 });
|
||||
await page.fill('input[placeholder="Project name"]', projectName);
|
||||
await page.fill('input[placeholder="Description (optional)"]', 'Project for task & comment testing');
|
||||
await page.click('button:has-text("Create")');
|
||||
await page.waitForSelector('.modal', { timeout: 10000 });
|
||||
await page.getByTestId('project-name-input').fill(projectName);
|
||||
await page.getByTestId('project-description-input').fill('Project for task & comment testing');
|
||||
await page.click('.modal button.btn-primary:has-text("Create")');
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
await page.waitForSelector(`.project-card:has-text("${projectName}")`, { timeout: 10000 });
|
||||
@@ -117,6 +117,19 @@ test.describe('Task & Comment Flow', () => {
|
||||
await expect(taskRow).toBeVisible({ timeout: 10000 });
|
||||
console.log('✅ Task created and verified');
|
||||
|
||||
// Edit the created task via task detail modal
|
||||
console.log('✏️ Editing created task...');
|
||||
await taskRow.click();
|
||||
await page.waitForURL(/\/tasks\/\d+$/, { timeout: 10000 });
|
||||
await page.click('button:has-text("Edit Task")');
|
||||
await page.waitForSelector('.modal.task-create-modal', { timeout: 10000 });
|
||||
const updatedTaskTitle = `${taskTitle} Updated`;
|
||||
await page.getByTestId('task-title-input').fill(updatedTaskTitle);
|
||||
await page.getByTestId('create-task-button').click();
|
||||
await page.waitForSelector('.modal.task-create-modal', { state: 'detached', timeout: 10000 });
|
||||
await expect(page.locator(`h2:has-text("${updatedTaskTitle}")`)).toBeVisible({ timeout: 10000 });
|
||||
console.log('✅ Task edited and verified');
|
||||
|
||||
// ── Step 5: Create a Task item (for comment testing) ───────────────
|
||||
// Milestone tasks don't have a detail page with comments, so we create
|
||||
// a Task item from the shared Tasks-page modal to test the comment flow.
|
||||
|
||||
Reference in New Issue
Block a user