Fix test selectors for branded nav text
- Use regex /Groom\s*Book/ to match split-element brand text
- Use getByRole("link") for Book CTA to avoid matching brand <strong>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -23,12 +23,12 @@ function renderApp(route = "/admin") {
|
|||||||
describe("App navigation", () => {
|
describe("App navigation", () => {
|
||||||
it("renders the Groom Book brand", () => {
|
it("renders the Groom Book brand", () => {
|
||||||
const nav = renderApp();
|
const nav = renderApp();
|
||||||
expect(within(nav).getByText("Groom Book")).toBeInTheDocument();
|
expect(within(nav).getByText(/Groom\s*Book/)).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("renders the Book CTA button", () => {
|
it("renders the Book CTA button", () => {
|
||||||
const nav = renderApp();
|
const nav = renderApp();
|
||||||
expect(within(nav).getByText("Book")).toBeInTheDocument();
|
expect(within(nav).getByRole("link", { name: "Book" })).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("renders all primary nav links", () => {
|
it("renders all primary nav links", () => {
|
||||||
@@ -61,6 +61,6 @@ describe("App navigation", () => {
|
|||||||
</MemoryRouter>
|
</MemoryRouter>
|
||||||
);
|
);
|
||||||
// Customer portal should render at root - no admin nav present
|
// Customer portal should render at root - no admin nav present
|
||||||
expect(screen.queryByText("Groom Book")).not.toBeInTheDocument();
|
expect(screen.queryByText(/Groom\s*Book/)).not.toBeInTheDocument();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user