vikunja/frontend/src/directives
Xela cbd5bf8d94 fix(frontend): use import.meta.env.MODE instead of DEV for testid directive
During E2E testing with Playwright (via `mage test:e2e`), the frontend is built using Vite with `--mode development`. However, Vite hardcodes `process.env.NODE_ENV` to `production` during the build step, which causes `import.meta.env.DEV` to statically evaluate to `false`.

Because the `v-cy` custom testing directive relied on the `DEV` flag, it silently evaluated to false and failed to render the `data-cy` attributes into the DOM during the test build. This caused test failures because Playwright could not locate the elements.

Changing the check to explicitly evaluate `import.meta.env.MODE === 'development'` successfully bypasses the Vite build behavior, ensuring that `data-cy` testing attributes are consistently rendered during E2E tests.

For more context on Vite's build behavior regarding `DEV` and development mode, see:
https://github.com/vitejs/vite/discussions/14083
2026-04-24 11:24:34 +02:00
..
focus.ts fix(frontend): make v-focus directive work with wrapper components 2026-01-10 21:59:06 +01:00
shortcut.ts refactor(shortcuts): update directive to use new shortcut module 2026-03-03 14:00:25 +01:00
testid.ts fix(frontend): use import.meta.env.MODE instead of DEV for testid directive 2026-04-24 11:24:34 +02:00