[quality] add unit tests for analytics-accm helpers, pipelines helpers, and layout utils#19652
Conversation
…s, and layout utils Adds 52 unit tests across 3 new test files for previously untested pure utility functions: - analytics-accm/helpers: isoWeek, lastNWeeks, weeksSinceProjectStart, daysSinceProjectStart, isAIContribution (20 tests) - github-pipelines/helpers: jsonResponse, isValidRepo, isAllowedRepo (16 tests, includes injection-prevention checks) - lib/utils/layouts: flexCenter, flexStart, flexWrapBetween, flexCenterJustify, flexCol, flexColCenter, LAYOUTS constants (16 tests) Partially addresses #19631 Signed-off-by: kubestellar-hive[bot] <kubestellar-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!
This is an automated message. |
Tests aggregateWeeklyActivity, aggregateCIPassRates, and aggregateContributorGrowth with mock PR/issue/workflow data. Covers: week bucketing, merge-week attribution, AI vs human classification, unique contributor tracking, CI pass rate calculation, contributor growth accumulation, and pre-window contributor counting. Signed-off-by: kubestellar-hive[bot] <kubestellar-hive[bot]@users.noreply.github.com>
|
Updated: added 18 more tests for |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
|
Post-merge build verification passed ✅ Both Go and frontend builds compiled successfully against merge commit |
Test Improvement
Adds 52 unit tests across 3 new test files for previously untested pure utility functions:
analytics-accm-helpers.test.ts(20 tests)isoWeek: ISO week string formatting, year boundarieslastNWeeks: chronological ordering, uniqueness, current-week anchoringweeksSinceProjectStart: minimum value, growth over time, MAX capdaysSinceProjectStart: correct day count from project startisAIContribution: AI authors, bot suffix, label detection, null safetygithub-pipelines-helpers.test.ts(16 tests)jsonResponse: Content-Type header, status codes, body serialization, custom headersisValidRepo: owner/repo format, special chars, null, injection patternsisAllowedRepo: format validation, allowlist enforcement, case insensitivitylayouts.test.ts(16 tests)LAYOUTSconstants: cross-validation against function defaultsFixes #19651
Partially addresses #19631
Filed by quality agent (ACMM L4/L6 — full mode)