diff --git a/sites/partners/src/pages/index.tsx b/sites/partners/src/pages/index.tsx
index e3d9000586..ef9d7c0adf 100644
--- a/sites/partners/src/pages/index.tsx
+++ b/sites/partners/src/pages/index.tsx
@@ -43,6 +43,15 @@ class formatWaitlistStatus {
return this.text
}
}
+
+class ApplicationsLink extends formatLinkCell {
+ init(params) {
+ super.init(params)
+ this.link.setAttribute("href", `/listings/${params.data.id}/applications`)
+ this.link.setAttribute("data-testid", "listing-status-cell")
+ }
+}
+
class ListingsLink extends formatLinkCell {
init(params) {
super.init(params)
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/partners/src/pages/sign-in.tsx b/sites/partners/src/pages/sign-in.tsx
index c3d02399dd..f1a3770605 100644
--- a/sites/partners/src/pages/sign-in.tsx
+++ b/sites/partners/src/pages/sign-in.tsx
@@ -13,9 +13,6 @@ import {
t,
ResendConfirmationModal,
RequestType,
- FormSignInMFACode,
- FormSignInAddPhone,
- FormSignInMFAType,
} from "@bloom-housing/ui-components"
import FormsLayout from "../layouts/forms"
import {
@@ -29,6 +26,9 @@ import {
onSubmitMfaCodeWithPhone,
onSubmitMfaCode,
} from "../lib/users/signInHelpers"
+import { FormSignInAddPhone } from "../components/users/FormSignInAddPhone"
+import { FormSignInMFACode } from "../components/users/FormSignInMFACode"
+import { FormSignInMFAType } from "../components/users/FormSignInMFAType"
const SignIn = () => {
const { login, requestMfaCode, userService } = useContext(AuthContext)
diff --git a/sites/partners/styles/overrides.scss b/sites/partners/styles/overrides.scss
index 608c456fad..9e37f598b9 100644
--- a/sites/partners/styles/overrides.scss
+++ b/sites/partners/styles/overrides.scss
@@ -51,16 +51,16 @@
--bloom-font-alt-sans: [ "Montserrat", "Open Sans", "Helvetica", "Arial", "Verdana",
"sans-serif" ];
--bloom-color-accent-cool: #297e73;
- --bloom-color-gray-700: "#000000";
- --bloom-color-gray-800: "#18252A";
- --bloom-color-gray-950: "#000000";
- --bloom-color-lush: "#feb70d";
+ --bloom-color-gray-700: #000000;
+ --bloom-color-gray-800: #18252A;
+ --bloom-color-gray-950: #000000;
+ --bloom-color-lush: #feb70d;
--bloom-color-primary-dark: rgb(0, 68, 69);
- --bloom-color-primary-darker: "#004445";
- --bloom-color-primary-light: "#F2F2F2";
+ --bloom-color-primary-darker: #004445;
+ --bloom-color-primary-light: #F2F2F2;
--bloom-color-primary-lighter: #f2f2f2;
--bloom-color-primary: rgb(41, 126, 115);
- --bloom-color-warn: "#feb70d";
+ --bloom-color-warn: #feb70d;
--bloom-font-serif: var(--detroit-font-serif);
--primary-appearance-hover-background-color: white;
--primary-appearance-hover-label-color: var(--bloom-color-primary);
diff --git a/sites/partners/tsconfig.json b/sites/partners/tsconfig.json
index 3e47600f6d..9438e92edb 100644
--- a/sites/partners/tsconfig.json
+++ b/sites/partners/tsconfig.json
@@ -1,10 +1,24 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
- "lib": ["dom", "dom.iterable", "esnext"],
+ "lib": [
+ "dom",
+ "dom.iterable",
+ "esnext"
+ ],
"jsx": "preserve",
- "allowJs": true
+ "allowJs": true,
+ "incremental": true
},
- "exclude": ["node_modules", "cypress", "cypress-file-upload"],
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
+ "exclude": [
+ "node_modules",
+ "cypress",
+ "cypress-file-upload",
+ "cypress.config.ts"
+ ],
+ "include": [
+ "next-env.d.ts",
+ "**/*.ts",
+ "**/*.tsx"
+ ]
}
diff --git a/sites/public/.jest/setup-tests.js b/sites/public/.jest/setup-tests.js
index 1c01bfe070..6c5f0cc429 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"
@@ -19,8 +18,6 @@ global.beforeEach(() => {
})
})
-configure({ testIdAttribute: "data-test-id" })
-
// 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/__tests__/eligibility_questionnaire/EligibilityAge.test.tsx b/sites/public/__tests__/eligibility_questionnaire/EligibilityAge.test.tsx
index 900bde227c..ae5a01d177 100644
--- a/sites/public/__tests__/eligibility_questionnaire/EligibilityAge.test.tsx
+++ b/sites/public/__tests__/eligibility_questionnaire/EligibilityAge.test.tsx
@@ -39,19 +39,23 @@ describe("", () => {
})
it("Clicks the Next button", async () => {
- await act(async () => {
+ act(() => {
render()
+ })
+
+ await act(async () => {
fireEvent.click(screen.getByText("55 - 61"))
fireEvent.click(screen.getByText("Next"))
})
-
expect(mockRouter.push.mock.calls.length).toBe(1)
expect(mockRouter.push.mock.calls[0][0]).toBe("/eligibility/disability")
})
it("Clicks the See results now button", async () => {
- await act(async () => {
+ act(() => {
render()
+ })
+ await act(async () => {
fireEvent.click(screen.getByText("See results now"))
})
diff --git a/sites/public/__tests__/eligibility_questionnaire/EligibilityDisability.test.tsx b/sites/public/__tests__/eligibility_questionnaire/EligibilityDisability.test.tsx
index c73194ec6d..37d482f3ba 100644
--- a/sites/public/__tests__/eligibility_questionnaire/EligibilityDisability.test.tsx
+++ b/sites/public/__tests__/eligibility_questionnaire/EligibilityDisability.test.tsx
@@ -41,8 +41,11 @@ describe("", () => {
})
it("Clicks the Next button", async () => {
- await act(async () => {
+ act(() => {
render()
+ })
+
+ await act(async () => {
fireEvent.click(screen.getByText("No"))
fireEvent.click(screen.getByText("Next"))
})
@@ -52,8 +55,11 @@ describe("", () => {
})
it("Clicks the See results now button", async () => {
- await act(async () => {
+ act(() => {
render()
+ })
+
+ await act(async () => {
fireEvent.click(screen.getByText("See results now"))
})
diff --git a/sites/public/__tests__/eligibility_questionnaire/EligibilityHouseholdSize.test.tsx b/sites/public/__tests__/eligibility_questionnaire/EligibilityHouseholdSize.test.tsx
index 468ac5b42d..0a7828e7b9 100644
--- a/sites/public/__tests__/eligibility_questionnaire/EligibilityHouseholdSize.test.tsx
+++ b/sites/public/__tests__/eligibility_questionnaire/EligibilityHouseholdSize.test.tsx
@@ -1,10 +1,4 @@
-import {
- render,
- fireEvent,
- screen,
- waitFor,
- waitForElementToBeRemoved,
-} from "@testing-library/react"
+import { render, fireEvent, screen } from "@testing-library/react"
import EligibilityHouseholdSize from "../../src/pages/eligibility/household"
import React from "react"
import { act } from "react-dom/test-utils"
@@ -32,8 +26,10 @@ describe("", () => {
})
it("Clicks the Next button", async () => {
- await act(async () => {
+ act(() => {
render()
+ })
+ await act(async () => {
userEvent.selectOptions(screen.getByLabelText("Household Size"), "two")
fireEvent.click(screen.getByText("Next"))
})
@@ -43,8 +39,10 @@ describe("", () => {
})
it("Clicks the See results now button", async () => {
- await act(async () => {
+ act(() => {
render()
+ })
+ await act(async () => {
userEvent.selectOptions(screen.getByLabelText("Household Size"), "two")
fireEvent.click(screen.getByText("See results now"))
})
diff --git a/sites/public/__tests__/eligibility_questionnaire/EligibilityIncome.test.tsx b/sites/public/__tests__/eligibility_questionnaire/EligibilityIncome.test.tsx
index 284767fcf3..357a198fe2 100644
--- a/sites/public/__tests__/eligibility_questionnaire/EligibilityIncome.test.tsx
+++ b/sites/public/__tests__/eligibility_questionnaire/EligibilityIncome.test.tsx
@@ -26,8 +26,11 @@ describe("", () => {
})
it("Clicks the See results now button", async () => {
- await act(async () => {
+ act(() => {
render()
+ })
+
+ await act(async () => {
fireEvent.click(screen.getByText("$10,000 - $19,999"))
fireEvent.click(screen.getByText("See results now"))
})
diff --git a/sites/public/__tests__/eligibility_questionnaire/EligibilityWelcome.test.tsx b/sites/public/__tests__/eligibility_questionnaire/EligibilityWelcome.test.tsx
index 919fbe137a..a23a1f33e6 100644
--- a/sites/public/__tests__/eligibility_questionnaire/EligibilityWelcome.test.tsx
+++ b/sites/public/__tests__/eligibility_questionnaire/EligibilityWelcome.test.tsx
@@ -22,8 +22,11 @@ describe("", () => {
})
it("Click Next button", async () => {
- await act(async () => {
+ act(() => {
render()
+ })
+
+ await act(async () => {
fireEvent.click(screen.getByText("Next"))
})
diff --git a/sites/public/cypress.config.ts b/sites/public/cypress.config.ts
new file mode 100644
index 0000000000..492c3f9781
--- /dev/null
+++ b/sites/public/cypress.config.ts
@@ -0,0 +1,27 @@
+import { defineConfig } from "cypress"
+
+export default defineConfig({
+ defaultCommandTimeout: 100000,
+ projectId: "bloom-public-reference",
+ pageLoadTimeout: 100000,
+ video: true,
+ videoUploadOnPasses: false,
+ viewportHeight: 800,
+ viewportWidth: 1280,
+ numTestsKeptInMemory: 0,
+ env: {
+ codeCoverage: {
+ url: "/api/__coverage__",
+ },
+ },
+ e2e: {
+ // We've imported your old cypress plugins here.
+ // You may want to clean this up later by importing these.
+ setupNodeEvents(on, config) {
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
+ return require("./cypress/plugins/index.js")(on, config)
+ },
+ baseUrl: "http://localhost:3000",
+ specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}",
+ },
+})
diff --git a/sites/public/cypress.json b/sites/public/cypress.json
deleted file mode 100644
index 72dfe51aab..0000000000
--- a/sites/public/cypress.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "baseUrl": "http://localhost:3000",
- "defaultCommandTimeout": 100000,
- "projectId": "bloom-public-reference",
- "pageLoadTimeout": 100000,
- "video": true,
- "videoUploadOnPasses": false,
- "viewportHeight": 800,
- "viewportWidth": 1280,
- "numTestsKeptInMemory": 0,
- "env": {
- "codeCoverage": {
- "url": "/api/__coverage__"
- }
- }
-}
diff --git a/sites/public/cypress/integration/listing-detail.spec.ts b/sites/public/cypress/e2e/listing-detail.spec.ts
similarity index 100%
rename from sites/public/cypress/integration/listing-detail.spec.ts
rename to sites/public/cypress/e2e/listing-detail.spec.ts
diff --git a/sites/public/cypress/integration/navigation.spec.ts b/sites/public/cypress/e2e/navigation.spec.ts
similarity index 100%
rename from sites/public/cypress/integration/navigation.spec.ts
rename to sites/public/cypress/e2e/navigation.spec.ts
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/cypress/support/index.js b/sites/public/cypress/support/e2e.js
similarity index 100%
rename from sites/public/cypress/support/index.js
rename to sites/public/cypress/support/e2e.js
diff --git a/sites/public/netlify.toml b/sites/public/netlify.toml
index 663867e933..6780e3b684 100644
--- a/sites/public/netlify.toml
+++ b/sites/public/netlify.toml
@@ -3,9 +3,12 @@
command = "yarn run build"
ignore = "/bin/false"
+[[plugins]]
+package = "@netlify/plugin-nextjs"
+
[build.environment]
-NODE_VERSION = "14.17.6"
+NODE_VERSION = "18.14.2"
YARN_VERSION = "1.22.4"
NEXT_TELEMETRY_DISABLED = "1"
NODE_OPTIONS = "--max_old_space_size=4096"
diff --git a/sites/public/next-env.d.ts b/sites/public/next-env.d.ts
index 9bc3dd46b9..4f11a03dc6 100644
--- a/sites/public/next-env.d.ts
+++ b/sites/public/next-env.d.ts
@@ -1,5 +1,4 @@
///
-///
///
// NOTE: This file should not be edited
diff --git a/sites/public/next.config.js b/sites/public/next.config.js
index 8e635b5e8c..637c9f5704 100644
--- a/sites/public/next.config.js
+++ b/sites/public/next.config.js
@@ -37,7 +37,6 @@ const tailwindVars = require("../../detroit-ui-components/tailwind.tosass.js")(b
// https://www.npmjs.com/package/next-transpile-modules
module.exports = withBundleAnalyzer(
withTM({
- target: "serverless",
env: {
backendApiBase: BACKEND_API_BASE,
listingServiceUrl: BACKEND_API_BASE + LISTINGS_QUERY,
diff --git a/sites/public/package.json b/sites/public/package.json
index d78c6a378e..6c7f13bfa4 100644
--- a/sites/public/package.json
+++ b/sites/public/package.json
@@ -28,38 +28,43 @@
"dependencies": {
"@bloom-housing/backend-core": "^4.4.0",
"@bloom-housing/shared-helpers": "^4.4.0",
- "@bloom-housing/ui-components": "^8.2.0",
+ "@bloom-housing/ui-components": "^12.0.2",
+ "@fortawesome/fontawesome-svg-core": "^6.1.1",
+ "@fortawesome/free-regular-svg-icons": "^6.1.1",
+ "@fortawesome/free-solid-svg-icons": "^6.1.1",
+ "@fortawesome/react-fontawesome": "^0.1.18",
"autoprefixer": "^10.3.4",
- "axios": "^0.21.1",
+ "axios": "^0.21.2",
"dayjs": "^1.10.7",
"dotenv": "^8.2.0",
"nanoid": "^3.1.12",
- "next": "^11.1.1",
- "next-plugin-custom-babel-config": "^1.0.2",
+ "next": "12.3.4",
+ "next-plugin-custom-babel-config": "^1.0.5",
"node-polyglot": "^2.4.0",
"node-sass": "^7.0.0",
- "openapi-client-axios": "^3.6.2",
+ "openapi-client-axios": "^7.1.3",
"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",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@2.2.10"
},
"devDependencies": {
- "@babel/core": "^7.11.6",
- "@cypress/code-coverage": "^3.9.12",
+ "@axe-core/react": "4.4.3",
+ "@babel/core": "^7.21.3",
+ "@cypress/code-coverage": "^3.10.3",
"@cypress/webpack-preprocessor": "^5.11.1",
+ "@netlify/plugin-nextjs": "4.30.4",
"@next/bundle-analyzer": "^10.1.0",
"@testing-library/dom": "^7.28.1",
"@testing-library/user-event": "^13.2.1",
- "@testing-library/react": "12.1.3",
- "@types/markdown-to-jsx": "^6.11.2",
+ "@testing-library/react": "14.0.0",
+ "@types/markdown-to-jsx": "7.0.1",
"@types/node": "^12.12.67",
- "@types/react": "^16.9.52",
"concurrently": "^5.3.0",
- "cypress": "^9.5.1",
+ "cypress": "^12.8.1",
"js-levenshtein": "^1.1.6",
"next-transpile-modules": "^8.0.0",
"nyc": "^15.1.0",
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"
/>