Skip to content

test(server): Resolves the remaining server-side gaps from #125. - #256

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
Pallavikumarimdb:issue-125-server-remaining-work
Jun 16, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
Pallavikumarimdb:issue-125-server-remaining-work

Conversation

@Pallavikumarimdb

Copy link
Copy Markdown
Contributor

Summary

Resolves the remaining server-side gaps from #125. Test infrastructure (#242, #243) was already merged; this branch finishes the job.

Changes

  • CI: added npm run test to the server job in .github/workflows/ci.yml so tests run on every PR and push to main
  • New test files:
    • server/src/lib/cloro-scraper.test.js - 15 tests covering parseScraperResponse across chatgpt-shopping, google-aio, google-aimode, and all other providers (text fallbacks, citation normalization, model defaults, shopping_cards handling, missing-key throws)
    • server/src/lib/cloro-webhook-verify.test.js - 7 tests for HMAC-SHA256 signature verification (valid, missing headers, invalid timestamp, stale, mismatch, v1= prefix stripping)
    • server/src/lib/dataforseo-codes.test.js - 10 tests for region/language code mapping (case-insensitivity, unknown/empty input, supported set)
    • server/src/lib/shopping-cards.test.js - 15 tests for card parsers, normalization, and brand/competitor matching (Perplexity, AI Mode, Copilot shapes; edge cases)
    • server/src/lib/tracking-pipeline.test.js - 6 mocked tests ported from test-tracking.js, validating mention/citation/visibility scoring end-to-end
    • server/src/lib/volumes-pipeline.test.js - 6 mocked tests ported from test-volumes.js, validating DataForSEO fetch flow, AI volume calculation, region coding, and model resolution
  • Removed: server/src/test-tracking.js and server/src/test-volumes.js - their logic is now covered by the automated suite

Related issue

Closes #125

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

@Pallavikumarimdb
Pallavikumarimdb force-pushed the issue-125-server-remaining-work branch from 95b5aca to 5744c56 Compare June 15, 2026 12:47
@Pallavikumarimdb
Pallavikumarimdb marked this pull request as ready for review June 15, 2026 12:56
@gkhngyk
gkhngyk merged commit dbc0e18 into ansvisor:main Jun 16, 2026
2 checks passed
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.

ci: add automated test job once test infra exists

2 participants