Skip to content

Add unit tests for the log display preferences #20188

Description

@MilosPaunovic

What

ui/src/composables/useLogDisplay.ts already has a spec, but the exports below have no coverage in it.

These four preferences persist how the logs view renders. Five of the module's ten exports are uncovered, including every one of the persisted refs.

What to do

Add cases to the existing ui/tests/unit/composables/useLogDisplay.spec.ts covering:

  • each preference reads its stored value on first access
  • each preference writes back when changed
  • a missing stored value falls back to the documented default
  • a malformed stored value falls back to the default instead of throwing
  • the same preference shared between two callers stays in sync
  • DENSITY_PADDING has an entry for every density the picker offers

Reference

The spec file itself shows the house style; ui/tests/unit/composables/useTenant.spec.ts is another example.

How to run

Install once, then run the whole suite:

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

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

cd ui && npm run test:unit -- tests/unit/composables/useLogDisplay.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.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/frontendNeeds frontend code changesgood first issueGreat issue for new contributorskind/cooldownGreat candidate for the cooldown period

Type

Fields

Stage

In progress

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions