SCRAPE-25: Add fixture-based unit tests for parseUnits() #29

Merged
stephen merged 1 commits from scraper/test-parse-units into dev 2026-02-07 11:09:27 -07:00
Owner

Summary

  • Added 6 new fixture-based tests for parseUnits() using sample-listing-empty.html and sample-listing-call.html HTML fixtures
  • Tests verify empty section handling (container present but no articles) and "Call for pricing" unit extraction
  • Validates raw string preservation for price fields, correct attribute extraction, and image_url handling when img elements are absent

Test Coverage

  • 28 total tests for parseUnits() across 9 describe blocks, all passing
  • Full test suite passes: 17 suites, 680 tests

Files Changed

  • tests/scraper/parseUnits.test.js - added fixture-based test sections

Test Plan

  • All 28 parseUnits tests pass
  • Full test suite passes with --runInBand
  • Rebased on latest dev
## Summary - Added 6 new fixture-based tests for parseUnits() using sample-listing-empty.html and sample-listing-call.html HTML fixtures - Tests verify empty section handling (container present but no articles) and "Call for pricing" unit extraction - Validates raw string preservation for price fields, correct attribute extraction, and image_url handling when img elements are absent ## Test Coverage - 28 total tests for parseUnits() across 9 describe blocks, all passing - Full test suite passes: 17 suites, 680 tests ## Files Changed - __tests__/scraper/parseUnits.test.js - added fixture-based test sections ## Test Plan - [x] All 28 parseUnits tests pass - [x] Full test suite passes with --runInBand - [x] Rebased on latest dev
stephen added 1 commit 2026-02-07 11:07:37 -07:00
Add fixture-based unit tests for parseUnits()
All checks were successful
CI/CD Pipeline - Apartment API / Scan Dependencies (pull_request) Successful in 15s
CI/CD Pipeline - Apartment API / Lint & Test (pull_request) Successful in 43s
CI/CD Pipeline - Apartment API / Send Webhook Notification (pull_request) Successful in 2s
CI/CD Pipeline - Apartment API / Build & Push Image (pull_request) Has been skipped
CI/CD Pipeline - Apartment API / Deploy to Production (pull_request) Has been skipped
6fad40eb2a
Add 6 new tests using sample-listing-empty.html and
sample-listing-call.html fixtures:

- Verify empty section container returns empty array
- Verify zero-count logging for empty fixtures
- Verify extraction of "Call for pricing" units
- Verify raw string preservation for price fields
- Verify all attribute extraction from call-for-pricing units
- Verify image_url handling when img elements are absent

Total parseUnits test coverage: 28 tests across 9 describe blocks.
stephen merged commit 80d44bca04 into dev 2026-02-07 11:09:27 -07:00
stephen deleted branch scraper/test-parse-units 2026-02-07 11:09:28 -07:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: stephen/apartment-dashboard-api#29
No description provided.