#19979·kestra

Add unit tests for rowKey

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

What

ui/packages/design-system/src/utils/rowKey.ts has no test yet.

It hands a stable v-for key to editable rows that have no id of their own. If it ever returned a different key for the same row object, every keystroke would remount the row and the input would lose focus.

What to do

Create ui/packages/design-system/tests/units/utils/rowKey.test.ts covering:

  • the same object returns the same key across calls
  • two different objects get different keys
  • two objects that are deeply equal but not identical still get different keys
  • the key matches the row-<n> shape

The cache is a module-level WeakMap, so the counter carries across cases within a file. Assert relationships between keys rather than exact numbers.

Reference

ui/packages/design-system/tests/units/utils/lang.test.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/packages/design-system && npm install && npm run test:unit

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

bash
cd ui/packages/design-system && npm run test:unit -- tests/units/utils/rowKey.test.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.