Skip to content

feat: redesign error alert #4403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Oct 7, 2022
Prev Previous commit
Next Next commit
fixed tests
  • Loading branch information
Kira-Pilot committed Oct 6, 2022
commit 7b5ef378afbbab08a34659fd5f7db2f138ebb428
13 changes: 10 additions & 3 deletions site/src/components/ErrorSummary/ErrorSummary.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { fireEvent, render, screen } from "@testing-library/react"
import { ErrorSummary } from "./ErrorSummary"
import { i18n } from "i18n"

const { t } = i18n

describe("ErrorSummary", () => {
it("renders", async () => {
Expand All @@ -26,7 +29,8 @@ describe("ErrorSummary", () => {
render(<ErrorSummary error={error} />)

// Then
fireEvent.click(screen.getByText("More"))
const expandText = t("ctas.expand", { ns: "common" })
fireEvent.click(screen.getByText(expandText))
const element = await screen.findByText(
"The resource you requested does not exist in the database.",
{ exact: false },
Expand All @@ -48,8 +52,11 @@ describe("ErrorSummary", () => {
render(<ErrorSummary error={error} />)

// Then
fireEvent.click(screen.getByText("More"))
fireEvent.click(screen.getByText("Less"))
const expandText = t("ctas.expand", { ns: "common" })
const collapseText = t("ctas.collapse", { ns: "common" })

fireEvent.click(screen.getByText(expandText))
fireEvent.click(screen.getByText(collapseText))
const element = await screen.findByText(
"The resource you requested does not exist in the database.",
{ exact: false },
Expand Down