All checks were successful
CI/CD Pipeline - Apartment API / Scan Dependencies (pull_request) Successful in 13s
CI/CD Pipeline - Apartment API / Run Linting (pull_request) Successful in 9m37s
CI/CD Pipeline - Apartment API / Run Tests (pull_request) Successful in 9m43s
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
- Extract apartment unit data from section.spaces__tab-unit container - Parse all data-spaces-* attributes from article elements - Deduplicate units by unit_code with warning logging - Handle missing container gracefully (returns empty array) - Add comprehensive test suite with HTML fixture (22 tests)
145 lines
4.7 KiB
HTML
145 lines
4.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>Country Club Towers - Available Units</title>
|
|
</head>
|
|
<body>
|
|
<div class="spaces-container">
|
|
<section class="spaces__tab-unit">
|
|
<!-- Unit 1: Fully populated with all attributes and an image -->
|
|
<article
|
|
data-spaces-id="1001"
|
|
data-spaces-unit="CCT-101"
|
|
data-spaces-unit-id="5001"
|
|
data-spaces-unit-floor="1"
|
|
data-spaces-sort-area="750"
|
|
data-spaces-sort-bed="1"
|
|
data-spaces-sort-bath="1"
|
|
data-spaces-sort-price="1450"
|
|
data-spaces-available="true"
|
|
data-spaces-unavailable="false"
|
|
data-spaces-soonest="2026-03-01"
|
|
data-spaces-sort-date="20260301"
|
|
data-spaces-plan-id="201"
|
|
data-spaces-sort-plan-name="Alpine"
|
|
data-spaces-obj="unit"
|
|
data-spaces-community="Country Club Towers"
|
|
data-spaces-asset="100"
|
|
data-spaces-href="/units/CCT-101"
|
|
data-spaces-inventory-href="/inventory/CCT-101"
|
|
data-spaces-specials-content="First month free!"
|
|
>
|
|
<div class="unit-card">
|
|
<img src="https://example.com/images/unit-101.jpg" alt="Unit 101" />
|
|
<h3>Unit CCT-101</h3>
|
|
<p>1 Bed / 1 Bath - $1,450/mo</p>
|
|
</div>
|
|
</article>
|
|
|
|
<!-- Unit 2: Different floor plan, no specials, with data-src image -->
|
|
<article
|
|
data-spaces-id="1002"
|
|
data-spaces-unit="CCT-205"
|
|
data-spaces-unit-id="5002"
|
|
data-spaces-unit-floor="2"
|
|
data-spaces-sort-area="950"
|
|
data-spaces-sort-bed="2"
|
|
data-spaces-sort-bath="1.5"
|
|
data-spaces-sort-price="1850"
|
|
data-spaces-available="true"
|
|
data-spaces-unavailable="false"
|
|
data-spaces-soonest="2026-02-15"
|
|
data-spaces-sort-date="20260215"
|
|
data-spaces-plan-id="202"
|
|
data-spaces-sort-plan-name="Birchwood"
|
|
data-spaces-obj="unit"
|
|
data-spaces-community="Country Club Towers"
|
|
data-spaces-asset="100"
|
|
data-spaces-href="/units/CCT-205"
|
|
data-spaces-inventory-href="/inventory/CCT-205"
|
|
data-spaces-specials-content=""
|
|
>
|
|
<div class="unit-card">
|
|
<img data-src="https://example.com/images/unit-205.jpg" alt="Unit 205" />
|
|
<h3>Unit CCT-205</h3>
|
|
</div>
|
|
</article>
|
|
|
|
<!-- Unit 3: Studio with some missing attributes -->
|
|
<article
|
|
data-spaces-id="1003"
|
|
data-spaces-unit="CCT-310"
|
|
data-spaces-unit-id="5003"
|
|
data-spaces-unit-floor="3"
|
|
data-spaces-sort-area="500"
|
|
data-spaces-sort-bed="0"
|
|
data-spaces-sort-bath="1"
|
|
data-spaces-sort-price="1100"
|
|
data-spaces-available="true"
|
|
data-spaces-unavailable="false"
|
|
data-spaces-soonest="Available Now"
|
|
data-spaces-sort-date="20260201"
|
|
data-spaces-plan-id="203"
|
|
data-spaces-sort-plan-name="Cedar"
|
|
data-spaces-obj="unit"
|
|
data-spaces-community="Country Club Towers"
|
|
data-spaces-asset="100"
|
|
data-spaces-href="/units/CCT-310"
|
|
data-spaces-inventory-href="/inventory/CCT-310"
|
|
>
|
|
<div class="unit-card">
|
|
<h3>Unit CCT-310</h3>
|
|
<p>Studio - $1,100/mo</p>
|
|
</div>
|
|
</article>
|
|
|
|
<!-- Unit 4: Unavailable unit -->
|
|
<article
|
|
data-spaces-id="1004"
|
|
data-spaces-unit="CCT-415"
|
|
data-spaces-unit-id="5004"
|
|
data-spaces-unit-floor="4"
|
|
data-spaces-sort-area="1200"
|
|
data-spaces-sort-bed="3"
|
|
data-spaces-sort-bath="2"
|
|
data-spaces-sort-price="2500"
|
|
data-spaces-available="false"
|
|
data-spaces-unavailable="true"
|
|
data-spaces-soonest=""
|
|
data-spaces-sort-date=""
|
|
data-spaces-plan-id="204"
|
|
data-spaces-sort-plan-name="Dogwood"
|
|
data-spaces-obj="unit"
|
|
data-spaces-community="Country Club Towers"
|
|
data-spaces-asset="100"
|
|
data-spaces-href="/units/CCT-415"
|
|
data-spaces-inventory-href="/inventory/CCT-415"
|
|
data-spaces-specials-content=""
|
|
>
|
|
<div class="unit-card">
|
|
<img src="https://example.com/images/unit-415.jpg" alt="Unit 415" />
|
|
<h3>Unit CCT-415</h3>
|
|
</div>
|
|
</article>
|
|
|
|
<!-- Unit 5: Minimal attributes - edge case -->
|
|
<article
|
|
data-spaces-id="1005"
|
|
data-spaces-unit="CCT-520"
|
|
data-spaces-unit-id="5005"
|
|
data-spaces-sort-price="1300"
|
|
data-spaces-available="true"
|
|
data-spaces-unavailable="false"
|
|
data-spaces-obj="unit"
|
|
data-spaces-community="Country Club Towers"
|
|
data-spaces-asset="100"
|
|
>
|
|
<div class="unit-card">
|
|
<h3>Unit CCT-520</h3>
|
|
</div>
|
|
</article>
|
|
</section>
|
|
</div>
|
|
</body>
|
|
</html>
|