Skip to content

test: cover queryOptions date range, clamping, and flag parsing - #277

Open
nococn wants to merge 1 commit into
Ashutosh00710:mainfrom
nococn:patch-1
Open

nococn wants to merge 1 commit into
Ashutosh00710:mainfrom
nococn:patch-1

Conversation

@nococn

@nococn nococn commented Nov 9, 2026

Copy link
Copy Markdown

Summary

Adds __test__/utils-query-options.test.ts covering previously untested Utilities.queryOptions() paths (src/utils.ts line coverage 55% -> 83%):

  • Valid from/to date range: UTC conversion and derived days (timezone-independent assertions)
  • Invalid ranges fall back to days=31: from after to, future dates, only one of from/to given
  • days validation: in-range value kept, out-of-range (>90) and non-numeric fall back to 31
  • radius clamped to [0, 16], height clamped to [200, 600], and their defaults (0 / 420)
  • area, grid, hide_title boolean parsing
  • hide_border: true yields transparent border color 0000
  • title_color falls back to the custom color when not set separately
  • custom_title is only set when provided

Verification

  • New file: 10/10 tests pass
  • Full suite: 18/19 pass; the single failure (GET /graph with correct credential expecting a Cache-Control header) fails identically on a clean checkout in this environment - it requires network access to the GitHub API and is unrelated to this change

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant