mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-18 17:05:48 +00:00
* test(e2e): strengthen reviewed assertions * test(e2e): tighten types and scope pageerror capture - markdown-link-persistence: merge compact/full op type into a single optional-field shape so `in`-based narrowing isn't needed, and add non-null assertions after `expect(...).not.toBeNull()` so the spec satisfies e2e tsconfig `strict: true`. - issue-provider-panel: attach the `pageerror` listener after the panel is open and detach before the final assertion to avoid attributing unrelated startup noise to the dialog loop. - recurring-task: document the prefix contract on `addTaskWithoutWaitingForTodayList` and why `BasePage.addTask` cannot be reused for future-dated tasks.
55 lines
2.1 KiB
TypeScript
55 lines
2.1 KiB
TypeScript
import { test, expect } from '../../fixtures/test.fixture';
|
|
|
|
const SIDENAV = 'magic-side-nav';
|
|
const ROUTER_WRAPPER = '.route-wrapper';
|
|
const SETTINGS_BTN = `${SIDENAV} nav-item:has([icon="settings"]) button, ${SIDENAV} .tour-settingsMenuBtn`;
|
|
|
|
test.describe.serial('Plugin Visibility', () => {
|
|
test('navigate to settings page', async ({ page, workViewPage }) => {
|
|
// Wait for work view to be ready
|
|
await workViewPage.waitForTaskList();
|
|
|
|
await page.click(SETTINGS_BTN);
|
|
await page.waitForSelector(ROUTER_WRAPPER, { state: 'visible' });
|
|
await expect(page).toHaveURL(/\/config/);
|
|
});
|
|
|
|
test('check page structure', async ({ page, workViewPage }) => {
|
|
// Wait for work view to be ready
|
|
await workViewPage.waitForTaskList();
|
|
|
|
// Navigate to settings
|
|
await page.click(SETTINGS_BTN);
|
|
await page.waitForSelector(ROUTER_WRAPPER, { state: 'visible' });
|
|
await page.getByRole('tab', { name: 'Plugins' }).click();
|
|
|
|
const settingsPage = page.locator('.page-settings');
|
|
const pluginManagement = page.locator('plugin-management');
|
|
await expect(settingsPage).toBeVisible();
|
|
await expect(page.locator('.plugin-section')).toBeVisible({ timeout: 10000 });
|
|
await expect(pluginManagement).toBeVisible({ timeout: 10000 });
|
|
});
|
|
|
|
test('settings page includes plugin content', async ({ page, workViewPage }) => {
|
|
// Wait for work view to be ready
|
|
await workViewPage.waitForTaskList();
|
|
|
|
// Navigate to settings
|
|
await page.click(SETTINGS_BTN);
|
|
await page.waitForSelector(ROUTER_WRAPPER, { state: 'visible' });
|
|
await page.getByRole('tab', { name: 'Plugins' }).click();
|
|
|
|
const settingsPage = page.locator('.page-settings');
|
|
const pluginManagement = page.locator('plugin-management');
|
|
const apiTestPluginCard = pluginManagement
|
|
.locator('mat-card')
|
|
.filter({ hasText: 'API Test Plugin' })
|
|
.first();
|
|
|
|
await expect(settingsPage).toBeVisible();
|
|
await expect(pluginManagement).toBeVisible({ timeout: 10000 });
|
|
await expect(apiTestPluginCard.locator('mat-card-title')).toHaveText(
|
|
'API Test Plugin',
|
|
);
|
|
});
|
|
});
|