From 17af0d3c317bcc814a17d361fae6e987b4d77f03 Mon Sep 17 00:00:00 2001 From: Kevin Beddingfield Date: Thu, 26 Dec 2024 12:18:52 -0500 Subject: [PATCH] removing some tests --- .../WiderThanMobileHeader.unit.spec.jsx | 19 --- .../Header/common/UserNav.unit.spec.jsx | 128 ------------------ 2 files changed, 147 deletions(-) delete mode 100644 src/applications/accredited-representative-portal/tests/unit/components/common/Header/WiderThanMobileHeader/WiderThanMobileHeader.unit.spec.jsx delete mode 100644 src/applications/accredited-representative-portal/tests/unit/components/common/Header/common/UserNav.unit.spec.jsx diff --git a/src/applications/accredited-representative-portal/tests/unit/components/common/Header/WiderThanMobileHeader/WiderThanMobileHeader.unit.spec.jsx b/src/applications/accredited-representative-portal/tests/unit/components/common/Header/WiderThanMobileHeader/WiderThanMobileHeader.unit.spec.jsx deleted file mode 100644 index 56b54cc28fc9..000000000000 --- a/src/applications/accredited-representative-portal/tests/unit/components/common/Header/WiderThanMobileHeader/WiderThanMobileHeader.unit.spec.jsx +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; -import { expect } from 'chai'; - -import WiderThanMobileLogoRow from '../../../../../../components/common/Header/WiderThanMobileHeader/WiderThanMobileLogoRow'; -import { renderTestApp } from '../../../../helpers'; - -describe('WiderThanMobileLogoRow', () => { - it('renders logo', () => { - const { getByTestId } = renderTestApp(); - expect(getByTestId('wider-than-mobile-logo-row-logo')).to.exist; - }); - - it('renders sign in link', () => { - const { getByTestId } = renderTestApp(); - expect( - getByTestId('user-nav-wider-than-mobile-sign-in-link').textContent, - ).to.eq('Sign in'); - }); -}); diff --git a/src/applications/accredited-representative-portal/tests/unit/components/common/Header/common/UserNav.unit.spec.jsx b/src/applications/accredited-representative-portal/tests/unit/components/common/Header/common/UserNav.unit.spec.jsx deleted file mode 100644 index 49abb6bafaf3..000000000000 --- a/src/applications/accredited-representative-portal/tests/unit/components/common/Header/common/UserNav.unit.spec.jsx +++ /dev/null @@ -1,128 +0,0 @@ -import React from 'react'; -import { fireEvent } from '@testing-library/react'; -import { expect } from 'chai'; - -import UserNav from '../../../../../../components/common/Header/common/UserNav'; -import { SIGN_IN_URL, SIGN_OUT_URL } from '../../../../../../constants'; -import { renderTestApp } from '../../../../helpers'; -import { - FETCH_USER_SUCCESS, - FETCH_USER_FAILURE, - FETCH_USER, -} from '../../../../../../actions/user'; - -describe('UserNav mobile', () => { - const isMobile = true; - - it('renders as Loading', () => { - const initAction = { - type: FETCH_USER, - }; - - const { getByTestId } = renderTestApp(, { - initAction, - }); - - expect(getByTestId('user-nav-loading-icon')).to.exist; - }); - - it('renders as Sign in link when no profile exists', () => { - const initAction = { - type: FETCH_USER_FAILURE, - }; - - const { getByTestId } = renderTestApp(, { - initAction, - }); - - const signInLink = getByTestId('user-nav-mobile-sign-in-link'); - - expect(signInLink.textContent).to.eq('Sign in'); - expect(signInLink.getAttribute('href')).to.eq(SIGN_IN_URL.toString()); - }); - - it('renders with first name when has profile', () => { - const profile = { - firstName: 'First', - lastName: 'Last', - }; - - const initAction = { - type: FETCH_USER_SUCCESS, - payload: { - account: {}, - profile, - }, - }; - - const { getByTestId } = renderTestApp(, { - initAction, - }); - - expect(getByTestId('user-nav-user-name').textContent).to.eq( - profile.firstName, - ); - fireEvent.click(getByTestId('user-nav-dropdown-panel-button')); - expect(getByTestId('user-nav-sign-out-link').getAttribute('href')).to.eq( - SIGN_OUT_URL.toString(), - ); - }); -}); - -describe('UserNav wider than mobile', () => { - const isMobile = false; - - it('renders as Loading', () => { - const initAction = { - type: FETCH_USER, - }; - - const { getByTestId } = renderTestApp(, { - initAction, - }); - - expect(getByTestId('user-nav-loading-icon')).to.exist; - }); - - it('renders as Sign in link when no profile exists', () => { - const initAction = { - type: FETCH_USER_FAILURE, - }; - - const { getByTestId } = renderTestApp(, { - initAction, - }); - - const signInLink = getByTestId('user-nav-wider-than-mobile-sign-in-link'); - - expect(signInLink.textContent).to.eq('Sign in'); - expect(signInLink.getAttribute('href')).to.eq(SIGN_IN_URL.toString()); - }); - - it('renders with first and last name when has profile', () => { - const profile = { - firstName: 'First', - lastName: 'Last', - }; - - const initAction = { - type: FETCH_USER_SUCCESS, - payload: { - account: {}, - profile, - }, - }; - - const { getByTestId } = renderTestApp(, { - initAction, - }); - - expect(getByTestId('user-nav-user-name').textContent).to.eq( - `${profile.firstName} ${profile.lastName}`, - ); - fireEvent.click(getByTestId('user-nav-dropdown-panel-button')); - expect(getByTestId('user-nav-sign-out-link').getAttribute('href')).to.eq( - SIGN_OUT_URL.toString(), - ); - }); -});