Skip to content

Commit

Permalink
replace "noop" in orcidlink testing with "noOp" in common [URO-209]
Browse files Browse the repository at this point in the history
  • Loading branch information
eapearson committed Jun 20, 2024
1 parent 0c65156 commit 1aba3e3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
18 changes: 9 additions & 9 deletions src/features/orcidlink/HomeLinked/ManageTab.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -18,8 +18,8 @@ describe('The ManageTab component', () => {
linkRecord={linkRecord}
profile={profile}
orcidSiteURL={orcidSiteURL}
removeLink={noop}
toggleShowInProfile={noop}
removeLink={noOp}
toggleShowInProfile={noOp}
/>
</MemoryRouter>
);
Expand All @@ -45,8 +45,8 @@ describe('The ManageTab component', () => {
linkRecord={linkRecord}
profile={profile}
orcidSiteURL={orcidSiteURL}
removeLink={noop}
toggleShowInProfile={noop}
removeLink={noOp}
toggleShowInProfile={noOp}
/>
</MemoryRouter>
);
Expand Down Expand Up @@ -95,7 +95,7 @@ describe('The ManageTab component', () => {
profile={profile}
orcidSiteURL={orcidSiteURL}
removeLink={removeLink}
toggleShowInProfile={noop}
toggleShowInProfile={noOp}
/>
</MemoryRouter>
);
Expand Down Expand Up @@ -137,8 +137,8 @@ describe('The ManageTab component', () => {
linkRecord={linkRecord}
profile={profile}
orcidSiteURL={orcidSiteURL}
removeLink={noop}
toggleShowInProfile={noop}
removeLink={noOp}
toggleShowInProfile={noOp}
/>
</MemoryRouter>
);
Expand Down Expand Up @@ -183,7 +183,7 @@ describe('The ManageTab component', () => {
linkRecord={linkRecord}
profile={profile}
orcidSiteURL={orcidSiteURL}
removeLink={noop}
removeLink={noOp}
toggleShowInProfile={toggleShowInProfile}
/>
</MemoryRouter>
Expand Down
12 changes: 6 additions & 6 deletions src/features/orcidlink/HomeLinked/view.test.tsx
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand All @@ -24,8 +24,8 @@ describe('The HomeLinked Component', () => {
info={info}
linkRecord={linkRecord}
profile={profile}
removeLink={noop}
toggleShowInProfile={noop}
removeLink={noOp}
toggleShowInProfile={noOp}
/>
);

Expand All @@ -48,8 +48,8 @@ describe('The HomeLinked Component', () => {
info={info}
linkRecord={linkRecord}
profile={profile}
removeLink={noop}
toggleShowInProfile={noop}
removeLink={noOp}
toggleShowInProfile={noOp}
/>
</MemoryRouter>
);
Expand Down Expand Up @@ -100,7 +100,7 @@ describe('The HomeLinked Component', () => {
info={info}
linkRecord={linkRecord}
profile={profile}
removeLink={noop}
removeLink={noOp}
toggleShowInProfile={toggleShowInProfile}
/>
</MemoryRouter>
Expand Down
8 changes: 0 additions & 8 deletions src/features/orcidlink/test/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 1aba3e3

Please sign in to comment.