diff --git a/.eslintrc.json b/.eslintrc.json index 24e5d51a7..b4c630b8b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,13 +3,15 @@ "browser": true, "node": true, "es2021": true, - "jest/globals": true + "jest/globals": true, + "cypress/globals": true }, "extends": [ "eslint:recommended", "plugin:react/recommended", "react-app", - "plugin:jsx-a11y/recommended" + "plugin:jsx-a11y/recommended", + "plugin:cypress/recommended" ], "globals": { "process": true @@ -30,7 +32,7 @@ "ecmaVersion": "latest", "sourceType": "module" }, - "plugins": ["react", "react-hooks", "jest", "jsx-a11y"], + "plugins": ["react", "react-hooks", "jest", "jsx-a11y", "cypress"], "rules": { // suppress errors for missing 'import React' in files "react/react-in-jsx-scope": "off", diff --git a/cypress/tests/us/home.cy.js b/cypress/tests/us/home.cy.js index d6d48210f..e6f612da7 100644 --- a/cypress/tests/us/home.cy.js +++ b/cypress/tests/us/home.cy.js @@ -22,7 +22,7 @@ describe('PolicyEngine Homepage', () => { checkCountryRedirect('us', regexArg) }) - it('should redirect from root to US homepage by if browser language is en-US', () => { + it('should redirect from root to US homepage if browser language is en-US', () => { Object.defineProperty(window.navigator, 'language', { value: 'en-US', configurable: true diff --git a/package-lock.json b/package-lock.json index 84113f1ec..88d952035 100644 --- a/package-lock.json +++ b/package-lock.json @@ -73,6 +73,7 @@ "cypress": "^13.16.0", "dotenv": "^16.4.5", "eslint": "^8.57.0", + "eslint-plugin-cypress": "^4.1.0", "eslint-plugin-jest": "^28.8.3", "eslint-plugin-react": "^7.37.2", "eslint-plugin-react-hooks": "^4.6.2", @@ -11169,6 +11170,31 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-plugin-cypress": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-4.1.0.tgz", + "integrity": "sha512-JhqkMY02mw74USwK9OFhectx3YSj6Co1NgWBxlGdKvlqiAp9vdEuQqt33DKGQFvvGS/NWtduuhWXWNnU29xDSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "globals": "^15.11.0" + }, + "peerDependencies": { + "eslint": ">=9" + } + }, + "node_modules/eslint-plugin-cypress/node_modules/globals": { + "version": "15.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.12.0.tgz", + "integrity": "sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint-plugin-flowtype": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-8.0.3.tgz", diff --git a/package.json b/package.json index 483c03bb6..5d353dfb3 100644 --- a/package.json +++ b/package.json @@ -101,6 +101,7 @@ "cypress": "^13.16.0", "dotenv": "^16.4.5", "eslint": "^8.57.0", + "eslint-plugin-cypress": "^4.1.0", "eslint-plugin-jest": "^28.8.3", "eslint-plugin-react": "^7.37.2", "eslint-plugin-react-hooks": "^4.6.2", diff --git a/src/layout/Section.jsx b/src/layout/Section.jsx index 6332fe208..ac6a39bd6 100644 --- a/src/layout/Section.jsx +++ b/src/layout/Section.jsx @@ -63,7 +63,7 @@ export default function Section({ alignItems: centeredTitle ? "center" : "baseline", }} > -

+

{title}