-
diff --git a/sites/partners/src/pages/_app.tsx b/sites/partners/src/pages/_app.tsx
index 054562bd96..9df1e95861 100644
--- a/sites/partners/src/pages/_app.tsx
+++ b/sites/partners/src/pages/_app.tsx
@@ -13,6 +13,8 @@ import "ag-grid-community/dist/styles/ag-grid.css"
import "ag-grid-community/dist/styles/ag-theme-alpine.css"
// Note: import overrides.scss last so that it overrides styles defined in imports above
import "../../styles/overrides.scss"
+import { useState } from "react"
+import { useEffect } from "react"
const signInMessage = "Login is required to view this page."
@@ -20,6 +22,12 @@ function BloomApp({ Component, router, pageProps }: AppProps) {
const { locale } = router
const skipLoginRoutes = ["/forgot-password", "/reset-password", "/users/confirm", "/users/terms"]
+ // fix for rehydation
+ const [hasMounted, setHasMounted] = useState(false)
+ useEffect(() => {
+ setHasMounted(true)
+ }, [])
+
useMemo(() => {
addTranslation(translations.general, true)
if (locale && locale !== "en" && translations[locale]) {
@@ -56,9 +64,7 @@ function BloomApp({ Component, router, pageProps }: AppProps) {
signInMessage={signInMessage}
skipForRoutes={skipLoginRoutes}
>
-
- {typeof window === "undefined" ? null : }
-
+ {hasMounted &&
}
diff --git a/sites/partners/src/pages/listings/[id]/index.tsx b/sites/partners/src/pages/listings/[id]/index.tsx
index 7452f0e6cf..6869054d57 100644
--- a/sites/partners/src/pages/listings/[id]/index.tsx
+++ b/sites/partners/src/pages/listings/[id]/index.tsx
@@ -84,7 +84,7 @@ export default function ListingDetail(props: ListingProps) {
title={
<>
{listing.name}
diff --git a/sites/public/.jest/setup-tests.js b/sites/public/.jest/setup-tests.js
index 1c01bfe070..13ddc6d94a 100644
--- a/sites/public/.jest/setup-tests.js
+++ b/sites/public/.jest/setup-tests.js
@@ -2,7 +2,6 @@
import { addTranslation } from "@bloom-housing/ui-components"
import general from "../../../detroit-ui-components/src/locales/general.json"
import general_overrides from "../src/page_content/locale_overrides/general.json"
-import { configure } from "@testing-library/dom"
import { serviceOptions } from "@bloom-housing/backend-core"
import axios from "axios"
import "@testing-library/jest-dom/extend-expect"
@@ -18,9 +17,7 @@ global.beforeEach(() => {
baseURL: "http://localhost:3000",
})
})
-
-configure({ testIdAttribute: "data-test-id" })
-
+xs
// Need to set __next on base div to handle the overlay
const portalRoot = document.createElement("div")
portalRoot.setAttribute("id", "__next")
diff --git a/sites/public/cypress/support/commands.js b/sites/public/cypress/support/commands.js
index c7f11d9d77..ebf4d035dd 100644
--- a/sites/public/cypress/support/commands.js
+++ b/sites/public/cypress/support/commands.js
@@ -10,34 +10,34 @@ import {
} from "./../mockData/applicationData"
Cypress.Commands.add("signIn", () => {
- cy.get(`[data-test-id="sign-in-email-field"]`).type("admin@example.com")
- cy.get(`[data-test-id="sign-in-password-field"]`).type("abcdef")
- cy.get(`[data-test-id="sign-in-button"]`).click()
+ cy.get(`[data-testid="sign-in-email-field"]`).type("admin@example.com")
+ cy.get(`[data-testid="sign-in-password-field"]`).type("abcdef")
+ cy.get(`[data-testid="sign-in-button"]`).click()
})
Cypress.Commands.add("signOut", () => {
- cy.get(`[data-test-id="My Account-2"]`).trigger("mouseover")
- cy.get(`[data-test-id="Sign Out-3"]`).trigger("click")
+ cy.get(`[data-testid="My Account-2"]`).trigger("mouseover")
+ cy.get(`[data-testid="Sign Out-3"]`).trigger("click")
})
Cypress.Commands.add("goNext", () => {
- return cy.get(`[data-test-id="app-next-step-button"]`).click()
+ return cy.get(`[data-testid="app-next-step-button"]`).click()
})
Cypress.Commands.add("getByTestId", (testId) => {
- return cy.get(`[data-test-id="${testId}"]`)
+ return cy.get(`[data-testid="${testId}"]`)
})
Cypress.Commands.add("getPhoneFieldByTestId", (testId) => {
- return cy.get(`[data-test-id="${testId}"]`).find("input")
+ return cy.get(`[data-testid="${testId}"]`).find("input")
})
Cypress.Commands.add("checkErrorAlert", (command) => {
- cy.get(`[data-test-id="alert-box"]`).should(command)
+ cy.get(`[data-testid="alert-box"]`).should(command)
})
Cypress.Commands.add("checkErrorMessages", (command) => {
- cy.get(`[data-test-id="error-message"]`).should(command)
+ cy.get(`[data-testid="error-message"]`).should(command)
})
Cypress.Commands.add("beginApplicationRejectAutofill", (listingName) => {
@@ -45,16 +45,16 @@ Cypress.Commands.add("beginApplicationRejectAutofill", (listingName) => {
cy.get(`[alt="${listingName}"]`).click()
cy.getByTestId("listing-view-apply-button").eq(1).click()
cy.getByTestId("app-choose-language-sign-in-button").click()
- cy.get("[data-test-id=sign-in-email-field]").type("admin@example.com")
- cy.get("[data-test-id=sign-in-password-field]").type("abcdef")
- cy.get("[data-test-id=sign-in-button").click()
+ cy.get("[data-testid=sign-in-email-field]").type("admin@example.com")
+ cy.get("[data-testid=sign-in-password-field]").type("abcdef")
+ cy.get("[data-testid=sign-in-button").click()
cy.getByTestId("app-choose-language-button").eq(0).click()
cy.getByTestId("app-next-step-button").click()
cy.getByTestId("application-initial-page").then(() => {
cy.get(".form-card__title").then(($header) => {
const headerText = $header.text()
if (headerText.includes("Save time by using the details from your last application")) {
- cy.get(`[data-test-id="autofill-decline"]`).click()
+ cy.get(`[data-testid="autofill-decline"]`).click()
} else {
cy.getByTestId("app-next-step-button").click()
}
@@ -159,7 +159,7 @@ Cypress.Commands.add("step3AlternateContactType", (application) => {
cy.getByTestId("app-alternate-type").eq(alternateContactTypeIndex).check()
if (application.alternateContact.type === "other") {
- cy.get("[data-test-id=app-alternate-other-type]").type(application.alternateContact.otherType)
+ cy.get("[data-testid=app-alternate-other-type]").type(application.alternateContact.otherType)
}
cy.goNext()
diff --git a/sites/public/package.json b/sites/public/package.json
index c76d40cc41..e2f4e6291d 100644
--- a/sites/public/package.json
+++ b/sites/public/package.json
@@ -28,7 +28,7 @@
"dependencies": {
"@bloom-housing/backend-core": "^4.4.0",
"@bloom-housing/shared-helpers": "^4.4.0",
- "@bloom-housing/ui-components": "^10.0.9",
+ "@bloom-housing/ui-components": "^12.0.0",
"autoprefixer": "^10.3.4",
"axios": "^0.21.1",
"dayjs": "^1.10.7",
@@ -40,8 +40,8 @@
"node-sass": "^7.0.0",
"openapi-client-axios": "^3.6.2",
"qs": "^6.10.1",
- "react": "^17.0.2",
- "react-dom": "^17.0.2",
+ "react": "18.2.0",
+ "react-dom": "18.2.0",
"react-hook-form": "^6.15.5",
"sass": "^1.41.1",
"swr": "^0.5.5",
diff --git a/sites/public/src/components/applications/HouseholdMemberForm.tsx b/sites/public/src/components/applications/HouseholdMemberForm.tsx
index 3f592cb6a3..eb8c4154a3 100644
--- a/sites/public/src/components/applications/HouseholdMemberForm.tsx
+++ b/sites/public/src/components/applications/HouseholdMemberForm.tsx
@@ -22,7 +22,7 @@ const HouseholdMemberForm = (props: HouseholdMemberFormProps) => {
className="edit-link"
onClick={() => props.editMember && props.editMember(props.memberId)}
type={"button"}
- data-test-id={"app-household-member-edit-button"}
+ data-testid={"app-household-member-edit-button"}
>
{t("t.edit")}
diff --git a/sites/public/src/components/applications/ValidateAddress.tsx b/sites/public/src/components/applications/ValidateAddress.tsx
index 7017559b1b..ce7bd3a14e 100644
--- a/sites/public/src/components/applications/ValidateAddress.tsx
+++ b/sites/public/src/components/applications/ValidateAddress.tsx
@@ -76,12 +76,12 @@ export const AddressValidationSelection = (props: AddressValidationSelectionProp
value="found"
checked={newAddressSelected}
onChange={(e) => setNewAddressSelected(e.target.checked)}
- data-test-id="app-found-address-choice"
+ data-testid="app-found-address-choice"
/>