Commit Graph

4 Commits

Author SHA1 Message Date
3b255a36de feat(events): add Programma tab to EventTabsNav for timetable access
The timetable canvas page at /events/{event}/timetable was added in
RFC-TIMETABLE Session 4 but had no UI entry point. EventTabsNav now
exposes it as the "Programma" tab between Artiesten and Briefings on
flat events, and between Artiesten and Briefings on festivals (in the
re-ordered tab list, post-Artiesten / pre-Briefings).

Changes:
- baseTabs gains the Programma entry at position 6 (after Artiesten).
- The festival re-order computed switches from positional indexing
  (baseTabs[5], [6], [7]) to name-based lookup via a findTab helper —
  insertions to baseTabs no longer break the festival branch.
- Icon: tabler-calendar-time. Conservative Dutch label "Programma" —
  doesn't collide with "Programmaonderdelen" (the festival sub-events
  page) since festivals see both tabs side-by-side.

vitest.config.ts: extend the component-project AutoImport to include
'vue-router' so tests of components that auto-import useRoute/useRouter
mount cleanly. (EventTabsNav was the first such test.)

tests/component/EventTabsNav.test.ts (NEW, 4 assertions):
- Programma tab is rendered with the correct label
- it carries the tabler-calendar-time icon
- the route binding resolves to the events-id-timetable name with the
  /events/.../timetable URL pattern
- the tab is also visible on a festival (re-ordered tab list path)

Mocks the useEvents composables so the component skips its skeleton/
error branches and renders tabs immediately.

Test count: 385 → 389.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-05-09 08:58:22 +02:00
5f135ec2b9 test: add mountWithVuexy helper, install axe-core, segment vitest configs
Foundation for the upcoming component / integration / a11y tests.

vitest.config.ts now declares two projects:
  - "unit"      — pure-logic tests under tests/unit/, src/**/__tests__/,
                  and tests/*.spec.ts (the legacy sanity test).
                  happy-dom, no Vuetify, fast path.
  - "component" — tests under tests/component/, tests/integration/,
                  tests/a11y/. jsdom, Vuetify inlined via SSR noExternal,
                  CSS imports processed (so :root token sheet loads), and
                  no global vue-router mock so the real router can run.

Both share the same alias map and AutoImport bag.

tests/utils/mountWithVuexy.ts (new):
  - Real Vuetify with the Crewli theme tokens
  - createTestingPinia (actions execute by default; stubActions opt-in)
  - vue-router with memory history at the configured initialPath + ?query
  - Fresh QueryClient per call (zero cross-test cache leak)
  - Notification mock injected via Pinia plugin so any useNotificationStore()
    resolves to { show: vi.fn(), hide: vi.fn() } — matches the actual
    NotificationStore API surface (per Phase A finding A4)
  - Imports `@/styles/tokens/_timetable.css` at module load so JSDOM resolves
    var(--tt-…) when components call getComputedStyle()

tests/setup.component.ts (new):
  - vitest-axe matcher registration
  - JSDOM polyfills: scrollIntoView, ResizeObserver, visualViewport, body
    bounding rect — Vuetify menus / overlays would crash without them
  - Deterministic crypto polyfill (mirrors tests/setup.ts so
    generateIdempotencyKey() is stable, but without the router mock)

tests/component/_smoke.test.ts (new):
  - Mounts a trivial component → asserts wrapper, queryClient, pinia,
    router, notificationMock all populated
  - Calls getComputedStyle(documentElement).getPropertyValue('--tt-status-confirmed-bg')
    → asserts '#e8f8f0' (proves the CSS token sheet really loaded)

devDependencies added: jsdom, axe-core, vitest-axe, @pinia/testing.

Total: 319 → 321 tests; 42 → 43 files. Both projects green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 03:27:31 +02:00
dcb8d53b61 style(app): apply eslint --fix to Tier 3 config files
WS-3 session 1b-ii Task 2 (audit Bucket X — 134 items).

Hand-reviewed quote-style/semi/arrow-parens autofixes on the three
config files explicitly excluded from session 1b-i:

- vite.config.ts (91 items, @typescript-eslint/quotes / semi /
  arrow-parens / curly). Plugin order verified unchanged by diff
  inspection (VueRouter → vue → vueJsx → vuetify → MetaLayouts →
  Components → AutoImport → svgLoader). One curly-add at the
  apexcharts resolver: \`if (componentName === 'VueApexCharts') { return {...} }\`
  — behaviorally identical to the prior braces-omitted form.
  Build smoke: pnpm build succeeded in 12.13s, zero warnings.

- themeConfig.ts (42 items, quotes / semi). Theme token values
  byte-identical, only surrounding quotes flipped from double to
  single. App title 'Crewli', logo span style, language labels and
  i18n codes all preserved.

- vitest.config.ts (1 item, lines-around-comment). Trivial: blank
  line added before the dts:false comment block.

No semantic changes. apps/app vitest 49 passed, vue-tsc clean,
pnpm build succeeded.

Lint baseline: 231 → 97 (Bucket X resolved).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 14:07:13 +02:00
d95e68423d test(apps/app): set up Vitest harness — closes TECH-APP-VITEST (WS-6)
Mirrors apps/portal's Vitest setup so the SPA can take frontend
unit + component tests. Required prerequisite for WS-6 sessie 3b's
admin UI work — apps/portal had 113+ tests, apps/app had zero, and
launching WS-6's organizer UI uncovered while the portal SPA is
well-tested would be asymmetric quality.

Setup:
- vitest, happy-dom, @vue/test-utils, @testing-library/vue installed
- vitest.config.ts mirrors portal config: trimmed auto-imports
  (no pinia/vue-router/vue-i18n/@vueuse/math) so tests run fast
  in happy-dom without loading the full Vuexy bundle
- AutoImport's dts:false prevents the trimmed test-only set from
  clobbering the dev-server's full auto-imports.d.ts (apps/app's
  auto-import surface is bigger than the portal's)
- tests/setup.ts mocks vue-router by default; tests that exercise
  the real router can override per-suite
- Sample sanity test confirms the harness works end-to-end

Adds `pnpm test` and `pnpm test:watch` scripts to package.json.

Refs: BACKLOG TECH-APP-VITEST, WS-6 sessie 3b prerequisite

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 00:14:18 +02:00