Skip to content

Commit

Permalink
tests added for links to how it works page
Browse files Browse the repository at this point in the history
  • Loading branch information
James Espy authored and James Espy committed Jun 3, 2024
1 parent d87ca81 commit 1ce4d48
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,20 @@ it("shows the correct dashboard banner CTA and sends telemetry for US users, wit
);
});

it("shows How It Works page link to US users, without Premium, no scan, no breaches", () => {
const ComposedDashboard = composeStory(
DashboardUsNoPremiumNoScanNoBreaches,
Meta,
);
render(<ComposedDashboard />);

const howItWorksLink = screen.getByRole("link", {
name: "Learn more",
});

expect(howItWorksLink).toHaveAttribute("href", "/how-it-works");
});

// Check dashboard banner content for story DashboardUsNoPremiumNoScanUnresolvedBreaches
it("shows the correct dashboard banner title for US users, without Premium, no scan, unresolved breaches", () => {
const ComposedDashboard = composeStory(
Expand Down Expand Up @@ -1296,6 +1310,20 @@ it("shows the correct dashboard banner CTA for US users, without Premium, no sca
);
});

it("shows How It Works page link to US users, without Premium, no scan, unresolved breaches", () => {
const ComposedDashboard = composeStory(
DashboardUsNoPremiumNoScanUnresolvedBreaches,
Meta,
);
render(<ComposedDashboard />);

const howItWorksLink = screen.getByRole("link", {
name: "Learn more",
});

expect(howItWorksLink).toHaveAttribute("href", "/how-it-works");
});

// Check dashboard banner content for story DashboardUsNoPremiumNoScanResolvedBreaches
it("shows the correct dashboard banner title for US users, without Premium, no scan, resolved breaches", () => {
const ComposedDashboard = composeStory(
Expand Down Expand Up @@ -1344,6 +1372,20 @@ it("shows the correct dashboard banner CTA and sends telemetry for US users, wit
);
});

it("shows How It Works page link to US users, without Premium, no scan, resolved breaches", () => {
const ComposedDashboard = composeStory(
DashboardUsNoPremiumNoScanResolvedBreaches,
Meta,
);
render(<ComposedDashboard />);

const howItWorksLink = screen.getByRole("link", {
name: "Learn more",
});

expect(howItWorksLink).toHaveAttribute("href", "/how-it-works");
});

it("shows and skips a dialog that informs US users, without Premium, when we hit the broker scan limit", async () => {
const user = userEvent.setup();
const ComposedDashboard = composeStory(
Expand Down Expand Up @@ -1375,6 +1417,20 @@ it("shows and skips a dialog that informs US users, without Premium, when we hit
).not.toBeInTheDocument();
});

it("shows How It Works page link to US users, without Premium, when we hit the broker scan limit", () => {
const ComposedDashboard = composeStory(
DashboardUsNoPremiumNoScanNoBreachesScanLimitReached,
Meta,
);
render(<ComposedDashboard />);

const howItWorksLink = screen.getByRole("link", {
name: "Learn more",
});

expect(howItWorksLink).toHaveAttribute("href", "/how-it-works");
});

it("shows and closes a dialog that informs US users, without Premium, when we hit the broker scan limit", async () => {
const user = userEvent.setup();
const ComposedDashboard = composeStory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,20 @@ it("shows the correct number of broker profiles with multiple broker scan result
expect(paragraphElement).toBeInTheDocument();
});

it("checks the How-It-Works page link", () => {
const ComposedWelcomeToPlusView = composeStory(
WelcomeToPlusViewInProgressStory,
Meta,
);
render(<ComposedWelcomeToPlusView />);

const howItWorksLink = screen.getByRole("link", {
name: "Removals typically take 7-14 days",
});

expect(howItWorksLink).toHaveAttribute("href", "/how-it-works");
});

it("checks the CTA button link to the next step in the guided resolution flow", () => {
const ComposedWelcomeToPlusView = composeStory(
WelcomeToPlusViewInProgressStory,
Expand Down

0 comments on commit 1ce4d48

Please sign in to comment.