#19973·kestra

Add unit tests for useActiveTab

Author: MilosPaunovicCreated Sep 30, 2026Updated Sep 30, 2026
Labelsarea/frontendkind/cooldowngood first issue

What

ui/src/composables/useActiveTab.ts has no test yet.

Tab identity is moving from a flat :tab route param to the matched child route's meta.tab. This composable is the bridge that keeps both working during the roll-out, so both branches need pinning.

What to do

Create ui/tests/unit/composables/useActiveTab.spec.ts covering:

  • route.meta.tab is returned when the page has been migrated to child routes
  • route.params.tab is returned when there is no meta.tab
  • meta.tab wins when both are present
  • undefined is returned when neither is set
  • the value is reactive, so changing the route updates it

Mount a tiny host component with a real vue-router memory-history router, or mock useRoute.

Reference

ui/tests/unit/composables/useTenant.spec.ts is an existing test of the same shape to copy from.

How to run

Install once, then run the whole suite:

bash
cd ui && npm install && npm run test:unit

While writing the test, run just this file so the feedback loop stays fast:

bash
cd ui && npm run test:unit -- tests/unit/composables/useActiveTab.spec.ts

Proof required in the PR

[!IMPORTANT] The PR that closes this issue must include a screenshot of the test passing, pasted into the PR description. Pasted text output is not enough.

To produce it, run the single-file command above and screenshot the terminal. The capture should show the command, the test file, and the green summary lines (Test Files 1 passed (1) and Tests N passed (N)). Then drag the image straight into the PR description field on GitHub, which uploads and embeds it.