Lint fixes

GitOrigin-RevId: 686f3fb718faf5830a34656d45f888c8e245f7f9
This commit is contained in:
Andrew Rumble
2025-07-03 14:17:53 +01:00
committed by Copybot
parent 1b03bb6e5d
commit 519b18e4a1
6 changed files with 38 additions and 23 deletions
@@ -8,6 +8,7 @@ type SwitchProps = {
function Switch({ onChange, checked, disabled = false }: SwitchProps) {
return (
// eslint-disable-next-line jsx-a11y/label-has-associated-control
<label className={classNames('switch-input', { disabled })}>
<input
className="invisible-input"
@@ -5,7 +5,6 @@ import { useTranslation } from 'react-i18next'
export const FullProjectMatchCounts: FC<{
loading: boolean
totalResults?: number
matchedFiles?: MatchedFile[]
}> = ({ loading, matchedFiles }) => {
const { t } = useTranslation()
@@ -28,7 +28,9 @@ describe('Add affiliation widget', function () {
renderWithProjectListContext(<AddAffiliation />)
await fetchMock.callHistory.flush(true)
await waitFor(() => expect(fetchMock.callHistory.called('/api/project')))
await waitFor(
() => expect(fetchMock.callHistory.called('/api/project')).to.be.true
)
await screen.findByText(/are you affiliated with an institution/i)
const addAffiliationLink = screen.getByRole('link', {
@@ -44,7 +46,9 @@ describe('Add affiliation widget', function () {
renderWithProjectListContext(<AddAffiliation />)
await fetchMock.callHistory.flush(true)
await waitFor(() => expect(fetchMock.callHistory.called('/api/project')))
await waitFor(
() => expect(fetchMock.callHistory.called('/api/project')).to.be.true
)
validateNonExistence()
})
@@ -58,7 +62,9 @@ describe('Add affiliation widget', function () {
})
await fetchMock.callHistory.flush(true)
await waitFor(() => expect(fetchMock.callHistory.called('/api/project')))
await waitFor(
() => expect(fetchMock.callHistory.called('/api/project')).to.be.true
)
validateNonExistence()
})
@@ -70,7 +76,9 @@ describe('Add affiliation widget', function () {
renderWithProjectListContext(<AddAffiliation />)
await fetchMock.callHistory.flush(true)
await waitFor(() => expect(fetchMock.callHistory.called('/api/project')))
await waitFor(
() => expect(fetchMock.callHistory.called('/api/project')).to.be.true
)
validateNonExistence()
})
@@ -34,7 +34,9 @@ describe('<TagsList />', function () {
renderWithProjectListContext(<TagsList />)
await fetchMock.callHistory.flush(true)
await waitFor(() => expect(fetchMock.callHistory.called('/api/project')))
await waitFor(
() => expect(fetchMock.callHistory.called('/api/project')).to.be.true
)
})
afterEach(function () {
@@ -241,8 +243,10 @@ describe('<TagsList />', function () {
fireEvent.click(saveButton)
await waitFor(() =>
expect(fetchMock.callHistory.called(`/tag/abc123def456/rename`))
await waitFor(
() =>
expect(fetchMock.callHistory.called(`/tag/abc123def456/edit`)).to.be
.true
)
await waitFor(
@@ -286,8 +290,9 @@ describe('<TagsList />', function () {
const deleteButton = within(modal).getByRole('button', { name: 'Delete' })
fireEvent.click(deleteButton)
await waitFor(() =>
expect(fetchMock.callHistory.called(`/tag/bcd234efg567`))
await waitFor(
() =>
expect(fetchMock.callHistory.called(`/tag/abc123def456`)).to.be.true
)
await waitFor(
@@ -307,8 +312,9 @@ describe('<TagsList />', function () {
const deleteButton = within(modal).getByRole('button', { name: 'Delete' })
fireEvent.click(deleteButton)
await waitFor(() =>
expect(fetchMock.callHistory.called(`/tag/bcd234efg567`))
await waitFor(
() =>
expect(fetchMock.callHistory.called('/tag/abc123def456')).to.be.true
)
await within(modal).findByText('Sorry, something went wrong')
@@ -58,15 +58,16 @@ describe('<InlineTags />', function () {
name: 'Remove tag My Test Tag',
})
fireEvent.click(removeButton)
await waitFor(() =>
expect(
fetchMock.callHistory.called(
`/tag/789fff789fff/project/${copyableProject.id}`,
{
method: 'DELETE',
}
)
)
await waitFor(
() =>
expect(
fetchMock.callHistory.called(
`/tag/789fff789fff/project/${copyableProject.id}`,
{
method: 'DELETE',
}
)
).to.be.true
)
expect(screen.queryByText('My Test Tag')).to.not.exist
screen.getByText('Tag 2')
@@ -100,8 +100,8 @@ describe('<SSOLinkingWidget />', function () {
})
)
fireEvent.click(confirmBtn)
await waitFor(() =>
expect(screen.getByRole('button', { name: 'Unlinking' }))
await waitFor(
() => expect(screen.getByRole('button', { name: 'Unlinking' })).to.exist
)
})
})