-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: QPF table should say "rain" if there is no ice or snow, instead …
…of "water" (#1866) * if there is only rain, say rain instead of water + tests * bump library
- Loading branch information
1 parent
5140445
commit baa40ff
Showing
5 changed files
with
91 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* eslint-disable no-await-in-loop, no-plusplus */ | ||
const { test, expect } = require("@playwright/test"); | ||
|
||
const { describe, beforeEach } = test; | ||
|
||
describe("quantitative precipitation forecast table", () => { | ||
beforeEach(async ({ page }) => { | ||
await page.goto("http://localhost:8081/play/testing"); | ||
await page.goto("http://localhost:8080/point/34.749/-92.275#daily"); | ||
}); | ||
|
||
test("shows snow, ice, and water when all are present", async ({ page }) => { | ||
const day = await page.locator(".wx-daily-forecast-block li").first(); | ||
await day.locator("span.toggle-text").click(); | ||
|
||
const headings = await day.locator(".wx-precip-table thead th"); | ||
|
||
// period, snow, ice, [separator], water | ||
await expect(headings).toHaveCount(5); | ||
await expect(headings.nth(0)).toHaveText("Time Period"); | ||
await expect(headings.nth(1)).toHaveText("Snow"); | ||
await expect(headings.nth(2)).toHaveText("Ice"); | ||
await expect(headings.nth(4)).toHaveText("Water"); | ||
}); | ||
|
||
test("shows snow and water when there is no ice", async ({ page }) => { | ||
const day = await page.locator(".wx-daily-forecast-block li").nth(1); | ||
await day.locator("span.toggle-text").click(); | ||
|
||
const headings = await day.locator(".wx-precip-table thead th"); | ||
|
||
// period, snow, [separator], water | ||
await expect(headings).toHaveCount(4); | ||
await expect(headings.nth(0)).toHaveText("Time Period"); | ||
await expect(headings.nth(1)).toHaveText("Snow"); | ||
await expect(headings.nth(3)).toHaveText("Water"); | ||
}); | ||
|
||
test("shows ice and water when there is no snow", async ({ page }) => { | ||
const day = await page.locator(".wx-daily-forecast-block li").nth(2); | ||
await day.locator("span.toggle-text").click(); | ||
|
||
const headings = await day.locator(".wx-precip-table thead th"); | ||
|
||
// period, ice, [separator], water | ||
await expect(headings).toHaveCount(4); | ||
await expect(headings.nth(0)).toHaveText("Time Period"); | ||
await expect(headings.nth(1)).toHaveText("Ice"); | ||
await expect(headings.nth(3)).toHaveText("Water"); | ||
}); | ||
|
||
test("shows rain when there is no snow or ice", async ({ page }) => { | ||
const day = await page.locator(".wx-daily-forecast-block li").nth(3); | ||
await day.locator("span.toggle-text").click(); | ||
|
||
const headings = await day.locator(".wx-precip-table thead th"); | ||
|
||
// period, rain | ||
await expect(headings).toHaveCount(2); | ||
await expect(headings.nth(0)).toHaveText("Time Period"); | ||
await expect(headings.nth(1)).toHaveText("Rain"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters