From e03b78666bc5626c4b70d6875ecd611b48c4666d Mon Sep 17 00:00:00 2001 From: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com> Date: Mon, 26 Feb 2024 21:24:48 +0700 Subject: [PATCH] chore(test): remove email-sign-up.test.js in favor of e2e (#53886) --- client/package.json | 1 - .../__snapshots__/email-sign-up.test.js.snap | 192 ------------------ client/src/pages/email-sign-up.test.js | 101 --------- pnpm-lock.yaml | 9 - 4 files changed, 303 deletions(-) delete mode 100644 client/src/pages/__snapshots__/email-sign-up.test.js.snap delete mode 100644 client/src/pages/email-sign-up.test.js diff --git a/client/package.json b/client/package.json index 9038d8ac63b..4cef17875a9 100644 --- a/client/package.json +++ b/client/package.json @@ -191,7 +191,6 @@ "monaco-editor-webpack-plugin": "4.2.0", "node-fetch": "2.7.0", "react-test-renderer": "16.14.0", - "redux-mock-store": "1.5.4", "redux-saga-test-plan": "4.0.6", "serve": "13.0.4", "ts-node": "10.9.2", diff --git a/client/src/pages/__snapshots__/email-sign-up.test.js.snap b/client/src/pages/__snapshots__/email-sign-up.test.js.snap deleted file mode 100644 index fd138d69978..00000000000 --- a/client/src/pages/__snapshots__/email-sign-up.test.js.snap +++ /dev/null @@ -1,192 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[` Authenticated user "accepted terms and condition" it should render correctly 1`] = `null`; - -exports[` Non-Authenticated user "not accepted terms and condition" it should render correctly 1`] = ` -
- -
-
-
-
-
-

- - learn.read-this.heading - -

-
-

- learn.read-this.p1 -

-

- learn.read-this.p2 -

-

- learn.read-this.p3 -

-

- learn.read-this.p4 -

-

- learn.read-this.p5 -

-

- learn.read-this.p6 -

-

- learn.read-this.p7 -

-

- learn.read-this.p8 -

-

- -

-

- learn.read-this.p10 -

-

- -

-

- learn.read-this.p12 -

- - misc.quincy - -
-
-
-
-
-
-
-

- misc.email-blast -

-
-
-
- -`; diff --git a/client/src/pages/email-sign-up.test.js b/client/src/pages/email-sign-up.test.js deleted file mode 100644 index bc1f8f423cb..00000000000 --- a/client/src/pages/email-sign-up.test.js +++ /dev/null @@ -1,101 +0,0 @@ -import { navigate } from 'gatsby'; -import React from 'react'; -import { Provider } from 'react-redux'; -import renderer from 'react-test-renderer'; -import configureStore from 'redux-mock-store'; -import EmailSignUp from './email-sign-up'; - -const middlewares = []; -const mockStore = configureStore(middlewares); - -jest.mock('../analytics'); - -jest.mock('gatsby', () => ({ - navigate: jest.fn() -})); - -describe('', () => { - let component; - let tree; - - describe('Non-Authenticated user "not accepted terms and condition"', () => { - beforeEach(() => { - const initialState = { - app: { - appUsername: '', - user: {}, - userFetchState: { - pending: false, - complete: true, - errored: false, - error: null - } - } - }; - - const store = mockStore(initialState); - const container = renderer.create( - - - - ); - - component = container.root; - tree = container.toJSON(); - }); - - it('it should render correctly', () => { - expect(tree).toMatchSnapshot(); - }); - - it('it should have a intro description section', () => { - // eslint-disable-next-line testing-library/await-async-query - const sectionIntroDescription = component.findByProps({ - className: 'intro-description' - }); - - expect(sectionIntroDescription).toBeTruthy(); - }); - }); - - describe('Authenticated user "accepted terms and condition"', () => { - beforeEach(() => { - const initialState = { - app: { - appUsername: 'John Doe', - user: { - 'John Doe': { - acceptedPrivacyTerms: true, - name: 'John Doe' - } - }, - userFetchState: { - pending: false, - complete: true, - errored: false, - error: null - } - } - }; - const store = mockStore(initialState); - store.dispatch = jest.fn(); - - const container = renderer.create( - - - - ); - - component = container.root; - tree = container.toJSON(); - }); - - it('it should render correctly', () => { - expect(tree).toMatchSnapshot(); - }); - - it('it should redirect to learn url', () => { - expect(navigate).toHaveBeenCalledWith('/learn'); - }); - }); -}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 892ddb922c9..31759e1e45f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -933,9 +933,6 @@ importers: react-test-renderer: specifier: 16.14.0 version: 16.14.0(react@16.14.0) - redux-mock-store: - specifier: 1.5.4 - version: 1.5.4 redux-saga-test-plan: specifier: 4.0.6 version: 4.0.6(@redux-saga/is@1.1.3)(@redux-saga/symbols@1.1.3)(redux-saga@1.2.3) @@ -28998,12 +28995,6 @@ packages: redux: 4.2.1 dev: false - /redux-mock-store@1.5.4: - resolution: {integrity: sha512-xmcA0O/tjCLXhh9Fuiq6pMrJCwFRaouA8436zcikdIpYWWCjU76CRk+i2bHx8EeiSiMGnB85/lZdU3wIJVXHTA==} - dependencies: - lodash.isplainobject: 4.0.6 - dev: true - /redux-observable@1.2.0(redux@4.2.1)(rxjs@6.6.7): resolution: {integrity: sha512-yeR90RP2WzZzCxxnQPlh2uFzyfFLsfXu8ROh53jGDPXVqj71uNDMmvi/YKQkd9ofiVoO4OYb1snbowO49tCEMg==} peerDependencies: