diff --git a/containers/tefca-viewer/e2e/query_workflow.spec.ts b/containers/tefca-viewer/e2e/query_workflow.spec.ts index 26284cd565..1c740d0e07 100644 --- a/containers/tefca-viewer/e2e/query_workflow.spec.ts +++ b/containers/tefca-viewer/e2e/query_workflow.spec.ts @@ -29,30 +29,33 @@ test.describe("querying with the TryTEFCA viewer", () => { ).toBeVisible(); }); - //TODO: Add this test back in once you no longer have to click to select the query from the dropdown - // test("unsuccessful user query: no patients", async ({ page }) => { - // await page.getByRole("button", { name: "Go to the demo" }).click(); - // await page - // .getByLabel("Query", { exact: true }) - // .selectOption("social-determinants"); - // await page.getByRole("button", { name: "Fill fields" }).click(); - - // await page.getByLabel("First Name").fill("Ellie"); - // await page.getByLabel("Last Name").fill("Williams"); - // await page.getByLabel("Phone Number").fill("5555555555"); - // await page.getByLabel("Medical Record Number").fill("TLOU1TLOU2"); - // await page.getByRole("button", { name: "Search for patient" }).click(); - - // // Better luck next time, user! - // await expect( - // page.getByRole("heading", { name: "No Patients Found" }) - // ).toBeVisible(); - // await expect(page.getByText("There are no patient records")).toBeVisible(); - // await page.getByRole("link", { name: "Search for a new patient" }).click(); - // await expect( - // page.getByRole("heading", { name: "Search for a Patient", exact: true }) - // ).toBeVisible(); - // }); + test("unsuccessful user query: no patients", async ({ page }) => { + await page.getByRole("button", { name: "Go to the demo" }).click(); + await page + .getByLabel("Query", { exact: true }) + .selectOption("social-determinants"); + await page.getByRole("button", { name: "Advanced" }).click(); + await page + .getByLabel("FHIR Server (QHIN)", { exact: true }) + .selectOption("HELIOS Meld: Direct"); + + await page.getByLabel("First Name").fill("Ellie"); + await page.getByLabel("Last Name").fill("Williams"); + await page.getByLabel("Phone Number").fill("5555555555"); + await page.getByLabel("Medical Record Number").fill("TLOU1TLOU2"); + await page.getByRole("button", { name: "Search for patient" }).click(); + + // Better luck next time, user! + await expect( + page.getByRole("heading", { name: "No Records Found" }), + ).toBeVisible(); + await expect( + page.getByText("No records were found for your search"), + ).toBeVisible(); + await page + .getByRole("link", { name: "Revise your patient search" }) + .click(); + }); test("successful demo user query: the quest for watermelon mcgee", async ({ page, diff --git a/containers/tefca-viewer/playwright.config.ts b/containers/tefca-viewer/playwright.config.ts index a33bd85dd5..c2ab4b9b5c 100644 --- a/containers/tefca-viewer/playwright.config.ts +++ b/containers/tefca-viewer/playwright.config.ts @@ -68,8 +68,8 @@ export default defineConfig({ // }, ], - /* Hook to ensure Docker is shut down after tests or on error */ - globalTeardown: "./playwright-teardown", /* Hook to ensure DB is started & migrations have run before tests start*/ globalSetup: "./playwright-setup", + /* Hook to ensure Docker is shut down after tests or on error */ + globalTeardown: "./playwright-teardown", }); diff --git a/containers/tefca-viewer/src/app/query/components/searchForm/SearchForm.tsx b/containers/tefca-viewer/src/app/query/components/searchForm/SearchForm.tsx index bd2b77dfad..ef733131ab 100644 --- a/containers/tefca-viewer/src/app/query/components/searchForm/SearchForm.tsx +++ b/containers/tefca-viewer/src/app/query/components/searchForm/SearchForm.tsx @@ -247,13 +247,15 @@ const SearchForm: React.FC = ({ id="fhir_server" name="fhir_server" value={fhirServer} + defaultValue={""} onChange={(event) => { setFhirServer(event.target.value as FHIR_SERVERS); }} required > {Object.keys(fhirServers).map((fhirServer: string) => (