Skip to content

fix: align test expectations with analysis reader behavior and single-document content#1604

Merged
pethers merged 2 commits intomainfrom
dependabot/npm_and_yarn/development-dependencies-47ad729628
Apr 8, 2026
Merged

fix: align test expectations with analysis reader behavior and single-document content#1604
pethers merged 2 commits intomainfrom
dependabot/npm_and_yarn/development-dependencies-47ad729628

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot bot commented on behalf of github Apr 8, 2026

Two Vitest failures on CI unrelated to the knip bump — caused by new single-document analysis content (2026-04-08) exposing stale test assumptions.

  • analysis-quality-validation.test.ts: dok_id density threshold was hard-coded to ≥2 for all strict-v2 synthesis files. Single-document analyses legitimately cite only 1 dok_id. Now scales minimum using extractDocumentsAnalyzedCount():

    const docCount = extractDocumentsAnalyzedCount(content);
    const minRequired = (docCount !== null && docCount <= 1) ? 1 : 2;
  • analysis-reader.test.ts: Test asserted root-level file precedence, but readAnalysisFile() intentionally prefers subdirectory files (AI-generated) over root-level (script-generated). Fixed assertion to match actual behavior ('LOW' from subdirectory, not 'HIGH' from root).

Bumps the development-dependencies group with 1 update: [knip](https://github.com/webpro-nl/knip/tree/HEAD/packages/knip).


Updates `knip` from 6.3.0 to 6.3.1
- [Release notes](https://github.com/webpro-nl/knip/releases)
- [Commits](https://github.com/webpro-nl/knip/commits/knip@6.3.1/packages/knip)

---
updated-dependencies:
- dependency-name: knip
  dependency-version: 6.3.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Dependency updates npm labels Apr 8, 2026
Copilot AI review requested due to automatic review settings April 8, 2026 10:36
@dependabot dependabot bot added dependencies Dependency updates npm labels Apr 8, 2026
@dependabot dependabot bot review requested due to automatic review settings April 8, 2026 10:36
@github-actions github-actions bot added the size-s Small change (10-50 lines) label Apr 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🏷️ Automatic Labeling Summary

This PR has been automatically labeled based on the files changed and PR metadata.

Applied Labels: dependencies,size-s,npm

Label Categories

  • 🗳️ Content: news, dashboard, visualization, intelligence
  • 💻 Technology: html-css, javascript, workflow, security
  • 📊 Data: cia-data, riksdag-data, data-pipeline, schema
  • 🌍 I18n: i18n, translation, rtl
  • 🔒 ISMS: isms, iso-27001, nist-csf, cis-controls
  • 🏗️ Infrastructure: ci-cd, deployment, performance, monitoring
  • 🔄 Quality: testing, accessibility, documentation, refactor
  • 🤖 AI: agent, skill, agentic-workflow

For more information, see .github/labeler.yml.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@pethers
Copy link
Copy Markdown
Member

pethers commented Apr 8, 2026

@copilot fix issues in TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request)
TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request)Failing after 1m

- analysis-quality-validation: allow ≥1 dok_id for single-document synthesis files
- analysis-reader: fix test to expect subdirectory preference (matches code behavior)

Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/bca6fa0f-684a-4987-82d3-b0f3062ee528

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 8, 2026 10:43
@dependabot dependabot bot review requested due to automatic review settings April 8, 2026 10:43
@github-actions github-actions bot added the testing Test coverage label Apr 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

@copilot fix issues in [TypeScript & JavaScript Testing / Unit Tests (Vitest) (pull_request)](https://github.com/Hack23/riksdagsmonitor/actions/runs/24130988814/job/70407283287?pr=1604...

Fixed in 5532a13. Two test failures were caused by new analysis content (2026-04-08) with only 1 document:

  1. analysis-quality-validation.test.ts — dok_id density check now allows ≥1 for single-document synthesis files (previously hard-coded ≥2)
  2. analysis-reader.test.ts — test expectation now matches actual code behavior (subdirectory files take precedence over root-level files)

All 4060 tests pass.

Copilot AI changed the title build(deps-dev): bump knip from 6.3.0 to 6.3.1 in the development-dependencies group fix: align test expectations with analysis reader behavior and single-document content Apr 8, 2026
Copilot AI requested a review from pethers April 8, 2026 10:48
@pethers pethers merged commit 0c5ade8 into main Apr 8, 2026
16 checks passed
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/development-dependencies-47ad729628 branch April 8, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependency updates npm size-s Small change (10-50 lines) testing Test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants