super-productivity/e2e/tests/project/project.spec.ts
Johannes Millan 9faf80c53e chore(e2e): remove broken/empty skipped tests
Remove tests that were skipped with no clear path to fix:
- project-note.spec.ts: Both tests broken (createAndGoToTestProject fails)
- planner-navigation: Remove broken project planner test
- project.spec.ts: Remove broken create second project test

Remaining skips are intentional:
- perf2.spec.ts: Slow performance test
- work-view.spec.ts: Documents known persistence bug
2026-01-03 17:49:43 +01:00

72 lines
2.7 KiB
TypeScript

import { expect, test } from '../../fixtures/test.fixture';
import { ProjectPage } from '../../pages/project.page';
import { WorkViewPage } from '../../pages/work-view.page';
test.describe('Project', () => {
let projectPage: ProjectPage;
let workViewPage: WorkViewPage;
test.beforeEach(async ({ page, testPrefix }) => {
projectPage = new ProjectPage(page, testPrefix);
workViewPage = new WorkViewPage(page, testPrefix);
// Wait for app to be ready
await workViewPage.waitForTaskList();
});
test('move done tasks to archive without error', async ({ page }) => {
// First navigate to Inbox project (not Today view) since archive button only shows in project views
const inboxMenuItem = page.locator('magic-side-nav button:has-text("Inbox")');
await inboxMenuItem.click();
// Add tasks using the page object method
await workViewPage.addTask('Test task 1', true); // skipClose=true to keep input open
await workViewPage.addTask('Test task 2');
// Mark first task as done
const firstTask = page.locator('task').first();
await firstTask.hover();
const doneBtn = firstTask.locator('.task-done-btn');
await doneBtn.waitFor({ state: 'visible' });
await doneBtn.click();
// Archive button should be visible in the done tasks section
const archiveBtn = page.locator('.e2e-move-done-to-archive');
await archiveBtn.waitFor({ state: 'visible' });
await archiveBtn.click();
// Verify one task remains and no error
const tasks = page.locator('task');
await expect(tasks).toHaveCount(1);
await expect(projectPage.globalErrorAlert).not.toBeVisible();
});
test('navigate to project settings', async ({ page }) => {
// Navigate to Inbox project
const inboxMenuItem = page.locator('magic-side-nav button:has-text("Inbox")');
await inboxMenuItem.click();
// Navigate directly to settings via the Settings nav item
const settingsMenuItem = page
.locator('magic-side-nav a[href="#/config"]')
.or(page.locator('magic-side-nav a.tour-settingsMenuBtn'))
.first();
await settingsMenuItem.click();
// Navigate to project settings tab/section if needed
const projectSettingsTab = page
.locator('button:has-text("Project"), [role="tab"]:has-text("Project")')
.first();
if (await projectSettingsTab.isVisible()) {
await projectSettingsTab.click();
}
// Verify we're on the settings page - look for any settings-related content
const settingsIndicator = page
.locator(
'h1:has-text("Settings"), h2:has-text("Settings"), .settings-section, mat-tab-group',
)
.first();
await expect(settingsIndicator).toBeVisible();
});
});