super-productivity/e2e/tests/all-basic-routes-without-error.spec.ts
Johannes Millan 7c03c84fad
feat(history): merge Quick History and Worklog into a unified History view (#8033)
* feat(history): merge Quick History and Worklog into one view

- single /history route; legacy worklog & quick-history redirect to it
- one History menu entry; navigate-to-task targets history
- show per-day work start-end as its own column in the day table
- show enabled habits/simple-counters (icon + tooltip) in the expanded day
- extract HistoryTaskRowComponent for archived task rows
- remove WorklogComponent and QuickHistoryComponent

* fix(history): restore quick history behavior

* refactor(history): collapse to a single unified view

- remove the Worklog/Quick History toggle; show one full all-time
  history tree (year -> month -> week -> day)
- drop the quick-history mode, significance filter and ?view= param
- extract shared HistoryDayMetaComponent; reuse HistoryTaskRowComponent
  in the Daily Summary "This Week" widget
- convert project colors + dateStr auto-expand to signals
- update e2e specs to the single-view selectors

* refactor(history): remove dead quick-history code and i18n keys

After merging Quick History into the unified History view, the
quick-history data pipeline had no consumers. Remove it:
- _quickHistoryData$, quickHistoryWeeks$, _loadQuickHistoryForWorkContext
- map-archive-to-worklog-weeks util (+ tz spec) and WorklogYearsWithWeeks
- orphaned F.QUICK_HISTORY, MH.QUICK_HISTORY, MH.WORKLOG translation keys

Keep WorklogWeekSimple (base of the still-used WorklogWeek).

* docs(history): reflect Quick History merge into unified History

The quick-history and worklog routes are now legacy aliases for the
single unified History view; drop the stale 'current-year mode/toggle'
framing. Concepts-note prose flagged for human review.

* feat(history): improve a11y and i18n of the unified history view

Accessibility:
- week table uses <thead> + <th scope=col>; icon-only work-times
  header gets a translated aria-label
- expandable day row: real <button> disclosure control carrying
  aria-expanded/aria-controls (keyboard + AT path) instead of a
  role=button <tr>; row keeps a pointer click
- archived-task title is now a <button> (was a non-focusable <span>)

i18n: translate previously hardcoded aria-labels (export/restore) and
the week-range tooltip; reuse VIEW_TASK_DETAILS/RESTORE_TASK_FROM_ARCHIVE,
add EXPORT_DATA + WEEK_RANGE_TOOLTIP keys.

Polish (carried in): convert worklogData$ to a toSignal signal (drop
AsyncPipe + dead animations), relocate the shared row to
features/worklog/worklog-task-row (WorklogTaskRowComponent) to break a
worklog<->history cycle, make template-unused services private, tighten
projectColor input type. SCSS focus rings use focus-ring tokens.

e2e: locate task titles via td.title button after the span->button change.
2026-06-05 18:10:56 +02:00

45 lines
1.6 KiB
TypeScript

import { test } from '../fixtures/test.fixture';
test.describe('All Basic Routes Without Error', () => {
test('should open all basic routes from menu without error', async ({
page,
workViewPage,
}) => {
// Load app and wait for work view
await workViewPage.waitForTaskList();
// Wait for magic-side-nav to be fully loaded
await page.locator('magic-side-nav').waitFor({ state: 'visible' });
// Helper to navigate and wait for route to load
const navigateAndWait = async (route: string): Promise<void> => {
await page.goto(route);
await page.locator('.route-wrapper').waitFor({ state: 'visible', timeout: 10000 });
};
// Navigate to schedule
await navigateAndWait('/#/tag/TODAY/schedule');
// Test that key navigation elements are visible and functional
await page.waitForSelector('magic-side-nav', { state: 'visible' });
// Test navigation to different routes by URL (the main goal of this test)
await navigateAndWait('/#/schedule');
await navigateAndWait('/#/tag/TODAY/tasks');
await navigateAndWait('/#/config');
// Navigate to different routes
await navigateAndWait('/#/tag/TODAY/history');
await navigateAndWait('/#/tag/TODAY/worklog');
await navigateAndWait('/#/tag/TODAY/quick-history');
await navigateAndWait('/#/tag/TODAY/metrics');
await navigateAndWait('/#/tag/TODAY/planner');
await navigateAndWait('/#/tag/TODAY/daily-summary');
await navigateAndWait('/#/tag/TODAY/settings');
// Send 'n' key to open notes dialog
await page.keyboard.press('n');
// Verify no errors in console (implicit with test passing)
});
});