diff --git a/cypress/plugins/index.ts b/cypress/plugins/index.ts index a455c839c..fb053af93 100644 --- a/cypress/plugins/index.ts +++ b/cypress/plugins/index.ts @@ -14,6 +14,7 @@ // This function is called when a project is opened or re-opened (e.g. due to // the project's config changing) +import webpackPreprocessor from "@cypress/webpack-preprocessor"; import dotenvPlugin from "cypress-dotenv"; const pluginConfig: Cypress.PluginConfig = (on, config) => { @@ -35,6 +36,27 @@ const pluginConfig: Cypress.PluginConfig = (on, config) => { }, }); + on( + "file:preprocessor", + webpackPreprocessor({ + webpackOptions: { + mode: "development", + module: { + rules: [ + { + test: /\.[jt]sx?$/, + exclude: /node_modules/, + use: "babel-loader", + }, + ], + }, + resolve: { + extensions: [".js", ".jsx", ".ts", ".tsx"], + }, + }, + }), + ); + return config; }; diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 525a74d31..23343cef2 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -85,7 +85,6 @@ Cypress.Commands.add("login", () => { audience: config.authAudience, client_id: config.authClientId, grant_type: "password", - scope: "openid email profile", }, }) .then(resp => { diff --git a/package.json b/package.json index 59712f352..da25f7935 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "@babel/preset-env": "^7.12.13", "@babel/preset-react": "^7.12.13", "@babel/preset-typescript": "^7.12.13", + "@cypress/webpack-preprocessor": "^5.9.1", "@graphql-codegen/cli": "^2.2.0", "@graphql-codegen/fragment-matcher": "^3.1.0", "@graphql-codegen/introspection": "^2.1.0", diff --git a/src/components/atoms/Notification/index.test.tsx b/src/components/atoms/Notification/index.test.tsx index 42627e5b3..353b6e172 100644 --- a/src/components/atoms/Notification/index.test.tsx +++ b/src/components/atoms/Notification/index.test.tsx @@ -10,21 +10,21 @@ const sampleNotification: Notification = { text: "This is a notification for something super cool.", }; -test.skip("Notification component should be rendered", () => { +test("Notification component should be rendered", () => { render(); }); -test.skip("Notification component should display notification heading", () => { +test("Notification component should display notification heading", () => { render(); expect(screen.getByText(/Notice/)).toBeInTheDocument(); }); -test.skip("Notification component should display notification text", () => { +test("Notification component should display notification text", () => { render(); expect(screen.getByText(/This is a notification/)).toBeInTheDocument(); }); -test.skip("Notification component should not display anything", () => { +test("Notification component should not display anything", () => { render(); expect(screen.getByText(/This is a notification/)).not.toBeVisible(); }); diff --git a/yarn.lock b/yarn.lock index 8b3a616e0..1852012d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1216,6 +1216,15 @@ tunnel-agent "^0.6.0" uuid "^8.3.2" +"@cypress/webpack-preprocessor@^5.9.1": + version "5.9.1" + resolved "https://registry.yarnpkg.com/@cypress/webpack-preprocessor/-/webpack-preprocessor-5.9.1.tgz#2694aa832baf3984d90bcb899e1ecff377560904" + integrity sha512-cg1ikftIo7NdlRA8ocNSxWjHJlh1JlTkN9ZfXUuKWWcJgrEdYLjXk0UzY6gYbLLaFka4oIhN6SvL5Y/7iELvgg== + dependencies: + bluebird "^3.7.1" + debug "4.3.2" + lodash "^4.17.20" + "@cypress/xvfb@^1.2.4": version "1.2.4" resolved "https://registry.yarnpkg.com/@cypress/xvfb/-/xvfb-1.2.4.tgz#2daf42e8275b39f4aa53c14214e557bd14e7748a" @@ -6132,7 +6141,7 @@ blob-util@^2.0.2: resolved "https://registry.yarnpkg.com/blob-util/-/blob-util-2.0.2.tgz#3b4e3c281111bb7f11128518006cdc60b403a1eb" integrity sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ== -bluebird@^3.3.5, bluebird@^3.5.5, bluebird@^3.7.2: +bluebird@^3.3.5, bluebird@^3.5.5, bluebird@^3.7.1, bluebird@^3.7.2: version "3.7.2" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== @@ -7840,7 +7849,7 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.9: dependencies: ms "2.0.0" -debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: +debug@4, debug@4.3.2, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==