Skip to content

chore: replace old ErrorSummary component #4417

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 3 commits into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed tests
  • Loading branch information
Kira-Pilot committed Oct 7, 2022
commit 56c7866d358117e92a98a92ee5c72f3573a53fc2
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { fireEvent, screen, waitFor } from "@testing-library/react"
import { Language as ErrorSummaryLanguage } from "components/ErrorSummary/ErrorSummary"
import * as API from "../../../api/api"
import { GlobalSnackbar } from "../../../components/GlobalSnackbar/GlobalSnackbar"
import * as AccountForm from "../../../components/SettingsAccountForm/SettingsAccountForm"
import { renderWithAuth } from "../../../testHelpers/renderHelpers"
import * as AuthXService from "../../../xServices/auth/authXService"
import { AccountPage } from "./AccountPage"
import i18next from "i18next"

const { t } = i18next

const renderPage = () => {
return renderWithAuth(
Expand Down Expand Up @@ -83,7 +85,8 @@ describe("AccountPage", () => {
const { user } = renderPage()
await fillAndSubmitForm()

const errorMessage = await screen.findByText(ErrorSummaryLanguage.unknownErrorMessage)
const errorText = t("warningsAndErrors.somethingWentWrong", { ns: "common" })
const errorMessage = await screen.findByText(errorText)
expect(errorMessage).toBeDefined()
expect(API.updateProfile).toBeCalledTimes(1)
expect(API.updateProfile).toBeCalledWith(user.id, newData)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { fireEvent, screen, waitFor } from "@testing-library/react"
import { Language as ErrorSummaryLanguage } from "components/ErrorSummary/ErrorSummary"
import * as API from "../../../api/api"
import { GlobalSnackbar } from "../../../components/GlobalSnackbar/GlobalSnackbar"
import * as SecurityForm from "../../../components/SettingsSecurityForm/SettingsSecurityForm"
import { renderWithAuth } from "../../../testHelpers/renderHelpers"
import * as AuthXService from "../../../xServices/auth/authXService"
import { SecurityPage } from "./SecurityPage"
import i18next from "i18next"

const { t } = i18next

const renderPage = () => {
return renderWithAuth(
Expand Down Expand Up @@ -105,7 +107,8 @@ describe("SecurityPage", () => {
const { user } = renderPage()
await fillAndSubmitForm()

const errorMessage = await screen.findByText(ErrorSummaryLanguage.unknownErrorMessage)
const errorText = t("warningsAndErrors.somethingWentWrong", { ns: "common" })
const errorMessage = await screen.findByText(errorText)
expect(errorMessage).toBeDefined()
expect(API.updateUserPassword).toBeCalledTimes(1)
expect(API.updateUserPassword).toBeCalledWith(user.id, newData)
Expand Down