From 1aba3e38052481c996463b081623137467ab50d1 Mon Sep 17 00:00:00 2001 From: Erik Pearson Date: Thu, 20 Jun 2024 17:48:16 +0000 Subject: [PATCH] replace "noop" in orcidlink testing with "noOp" in common [URO-209] --- .../orcidlink/HomeLinked/ManageTab.test.tsx | 18 +++++++++--------- .../orcidlink/HomeLinked/view.test.tsx | 12 ++++++------ src/features/orcidlink/test/mocks.ts | 8 -------- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/src/features/orcidlink/HomeLinked/ManageTab.test.tsx b/src/features/orcidlink/HomeLinked/ManageTab.test.tsx index 8dad52f8..b8b1ffc3 100644 --- a/src/features/orcidlink/HomeLinked/ManageTab.test.tsx +++ b/src/features/orcidlink/HomeLinked/ManageTab.test.tsx @@ -2,8 +2,8 @@ import { screen } from '@testing-library/dom'; import { render, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { MemoryRouter } from 'react-router-dom'; +import { noOp } from '../../common'; import { LINK_RECORD_1, PROFILE_1 } from '../test/data'; -import { noop } from '../test/mocks'; import ManageTab from './ManageTab'; describe('The ManageTab component', () => { @@ -18,8 +18,8 @@ describe('The ManageTab component', () => { linkRecord={linkRecord} profile={profile} orcidSiteURL={orcidSiteURL} - removeLink={noop} - toggleShowInProfile={noop} + removeLink={noOp} + toggleShowInProfile={noOp} /> ); @@ -45,8 +45,8 @@ describe('The ManageTab component', () => { linkRecord={linkRecord} profile={profile} orcidSiteURL={orcidSiteURL} - removeLink={noop} - toggleShowInProfile={noop} + removeLink={noOp} + toggleShowInProfile={noOp} /> ); @@ -95,7 +95,7 @@ describe('The ManageTab component', () => { profile={profile} orcidSiteURL={orcidSiteURL} removeLink={removeLink} - toggleShowInProfile={noop} + toggleShowInProfile={noOp} /> ); @@ -137,8 +137,8 @@ describe('The ManageTab component', () => { linkRecord={linkRecord} profile={profile} orcidSiteURL={orcidSiteURL} - removeLink={noop} - toggleShowInProfile={noop} + removeLink={noOp} + toggleShowInProfile={noOp} /> ); @@ -183,7 +183,7 @@ describe('The ManageTab component', () => { linkRecord={linkRecord} profile={profile} orcidSiteURL={orcidSiteURL} - removeLink={noop} + removeLink={noOp} toggleShowInProfile={toggleShowInProfile} /> diff --git a/src/features/orcidlink/HomeLinked/view.test.tsx b/src/features/orcidlink/HomeLinked/view.test.tsx index 305a264f..4188cc44 100644 --- a/src/features/orcidlink/HomeLinked/view.test.tsx +++ b/src/features/orcidlink/HomeLinked/view.test.tsx @@ -1,8 +1,8 @@ import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { MemoryRouter } from 'react-router-dom'; +import { noOp } from '../../common'; import { LINK_RECORD_1, PROFILE_1, SERVICE_INFO_1 } from '../test/data'; -import { noop } from '../test/mocks'; import HomeLinked from './view'; describe('The HomeLinked Component', () => { @@ -24,8 +24,8 @@ describe('The HomeLinked Component', () => { info={info} linkRecord={linkRecord} profile={profile} - removeLink={noop} - toggleShowInProfile={noop} + removeLink={noOp} + toggleShowInProfile={noOp} /> ); @@ -48,8 +48,8 @@ describe('The HomeLinked Component', () => { info={info} linkRecord={linkRecord} profile={profile} - removeLink={noop} - toggleShowInProfile={noop} + removeLink={noOp} + toggleShowInProfile={noOp} /> ); @@ -100,7 +100,7 @@ describe('The HomeLinked Component', () => { info={info} linkRecord={linkRecord} profile={profile} - removeLink={noop} + removeLink={noOp} toggleShowInProfile={toggleShowInProfile} /> diff --git a/src/features/orcidlink/test/mocks.ts b/src/features/orcidlink/test/mocks.ts index b93bf530..d8ab8956 100644 --- a/src/features/orcidlink/test/mocks.ts +++ b/src/features/orcidlink/test/mocks.ts @@ -160,11 +160,3 @@ export function setupMockRegularUserWithError() { } ); } - -/** - * This is an empty function that serves as a placeholder for props that expect - * one, but in tests in which these props are not tested, so they need not do anything. - */ -export function noop() { - // do nothing -}