Skip to content

Commit

Permalink
Merge pull request #1404 from weather-gov/mgwalker/1316-empty-nights
Browse files Browse the repository at this point in the history
Filter out empty day periods
  • Loading branch information
greg-does-weather committed Jul 3, 2024
2 parents ee60d32 + c19f458 commit 1f0177e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
6 changes: 5 additions & 1 deletion tests/api/data/testing/points/21.305,-157.858.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"@bundle": {
"name": "has extra overnight period for today"
"name": "Honolulu, HI",
"attributes": [
"has preceding overnight period for today",
"has only day time period for 7th day (no night period)"
]
},
"@context": [
"https://geojson.org/geojson-ld/geojson-context.jsonld",
Expand Down
18 changes: 18 additions & 0 deletions tests/playwright/e2e/daily-forecast.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { test, expect } = require("@playwright/test");

const { describe, beforeEach } = test;

describe("daily forecast", () => {
beforeEach(async ({ page }) => {
await page.goto("http://localhost:8081/play/testing");
});

test("does not display missing day periods", async ({ page }) => {
await page.goto("/point/21.305/-157.858");
const lastDay = page.locator(".wx-daily-forecast-block li").last();

const periods = lastDay.locator(".wx-daily-forecast-summary-area");

await expect(periods).toHaveCount(1);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ only be a nighttime period.
</div>
</div>
<div class="grid-row grid-gap">
{% for period in periods %}
{% for period in periods | filter(v => v) %}
{% set marginUnit = 3 %}
{% set tabletMarginUnit = 1 %}
{% set tabletCol = 6 %}
Expand Down

0 comments on commit 1f0177e

Please sign in to comment.