Skip to content

Commit

Permalink
[Issue #2029] Merge Nava fork to HHS (#2173)
Browse files Browse the repository at this point in the history
  • Loading branch information
acouch committed Sep 18, 2024
1 parent f403c25 commit ae72ed6
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 42 deletions.
2 changes: 2 additions & 0 deletions .grype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ ignore:
- vulnerability: CVE-2023-39418
- vulnerability: CVE-2023-5868
- vulnerability: CVE-2023-5870
# Affects SSR in pages router which we don't use https://github.com/advisories/GHSA-gp8f-8m3g-qvj9
- vulnerability: GHSA-gp8f-8m3g-qvj9
4 changes: 2 additions & 2 deletions analytics/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ ifeq "$(PY_RUN_APPROACH)" "local"
POETRY := poetry run
GITHUB := gh
else
POETRY := docker-compose run $(DOCKER_EXEC_ARGS) --rm $(APP_NAME) poetry run
GITHUB := docker-compose run $(DOCKER_EXEC_ARGS) --rm $(APP_NAME) gh
POETRY := docker compose run $(DOCKER_EXEC_ARGS) --rm $(APP_NAME) poetry run
GITHUB := docker compose run $(DOCKER_EXEC_ARGS) --rm $(APP_NAME) gh
endif

# Docker user configuration
Expand Down
14 changes: 7 additions & 7 deletions analytics/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 1 addition & 31 deletions frontend/tests/e2e/search/search-loading.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Page, expect, test } from "@playwright/test";
import {
expectURLContainsQueryParam,
fillSearchInputAndSubmit,
} from "./searchSpecUtil";
import { fillSearchInputAndSubmit } from "./searchSpecUtil";

import { BrowserContextOptions } from "playwright-core";

Expand All @@ -18,33 +15,6 @@ test.describe("Search page tests", () => {
await page.goto("/search?_ff=showSearchV0:true");
});

test("should return 0 results when searching for obscure term", async ({
page,
browserName,
}: PageProps) => {
// TODO (Issue #2005): fix test for webkit
test.skip(
browserName === "webkit",
"Skipping test for WebKit due to a query param issue.",
);

const searchTerm = "0resultearch";

await fillSearchInputAndSubmit(searchTerm, page);
await new Promise((resolve) => setTimeout(resolve, 3250));
expectURLContainsQueryParam(page, "query", searchTerm);

// eslint-disable-next-line testing-library/prefer-screen-queries
const resultsHeading = page.getByRole("heading", {
name: /0 Opportunities/i,
});
await expect(resultsHeading).toBeVisible();

await expect(page.locator("div.usa-prose h2")).toHaveText(
"Your search did not return any results.",
);
});

test("should show and hide loading state", async ({
page,
browserName,
Expand Down
47 changes: 47 additions & 0 deletions frontend/tests/e2e/search/search-no-results.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { Page, expect, test } from "@playwright/test";
import {
expectURLContainsQueryParam,
fillSearchInputAndSubmit,
} from "./searchSpecUtil";

import { BrowserContextOptions } from "playwright-core";

interface PageProps {
page: Page;
browserName?: string;
contextOptions?: BrowserContextOptions;
}

test.describe("Search page tests", () => {
test.beforeEach(async ({ page }: PageProps) => {
// Navigate to the search page with the feature flag set
await page.goto("/search?_ff=showSearchV0:true");
});

test("should return 0 results when searching for obscure term", async ({
page,
browserName,
}: PageProps) => {
// TODO (Issue #2005): fix test for webkit
test.skip(
browserName === "webkit",
"Skipping test for WebKit due to a query param issue.",
);

const searchTerm = "0resultearch";

await fillSearchInputAndSubmit(searchTerm, page);
await new Promise((resolve) => setTimeout(resolve, 3250));
expectURLContainsQueryParam(page, "query", searchTerm);

// eslint-disable-next-line testing-library/prefer-screen-queries
const resultsHeading = page.getByRole("heading", {
name: /0 Opportunities/i,
});
await expect(resultsHeading).toBeVisible();

await expect(page.locator("div.usa-prose h2")).toHaveText(
"Your search did not return any results.",
);
});
});
2 changes: 0 additions & 2 deletions frontend/tests/e2e/search/search.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ interface PageProps {

test.describe("Search page tests", () => {
test.beforeEach(async ({ page }: PageProps) => {

// Navigate to the search page with the feature flag set
await page.goto("/search?_ff=showSearchV0:true");
});

test("should refresh and retain filters in a new tab", async ({
page,
}: PageProps) => {

// Set all inputs, then refresh the page. Those same inputs should be
// set from query params.
const searchTerm = "education";
Expand Down

0 comments on commit ae72ed6

Please sign in to comment.