Răsfoiți Sursa

Lint fixes

GitOrigin-RevId: 686f3fb718faf5830a34656d45f888c8e245f7f9
Andrew Rumble 1 an în urmă
părinte
comite
519b18e4a1

+ 1 - 0
services/web/frontend/js/shared/components/switch.tsx

@@ -8,6 +8,7 @@ type SwitchProps = {
 
 
 function Switch({ onChange, checked, disabled = false }: SwitchProps) {
 function Switch({ onChange, checked, disabled = false }: SwitchProps) {
   return (
   return (
+    // eslint-disable-next-line jsx-a11y/label-has-associated-control
     <label className={classNames('switch-input', { disabled })}>
     <label className={classNames('switch-input', { disabled })}>
       <input
       <input
         className="invisible-input"
         className="invisible-input"

+ 0 - 1
services/web/modules/full-project-search/frontend/js/components/full-project-match-counts.tsx

@@ -5,7 +5,6 @@ import { useTranslation } from 'react-i18next'
 
 
 export const FullProjectMatchCounts: FC<{
 export const FullProjectMatchCounts: FC<{
   loading: boolean
   loading: boolean
-  totalResults?: number
   matchedFiles?: MatchedFile[]
   matchedFiles?: MatchedFile[]
 }> = ({ loading, matchedFiles }) => {
 }> = ({ loading, matchedFiles }) => {
   const { t } = useTranslation()
   const { t } = useTranslation()

+ 12 - 4
services/web/test/frontend/features/project-list/components/sidebar/add-affiliation.test.tsx

@@ -28,7 +28,9 @@ describe('Add affiliation widget', function () {
     renderWithProjectListContext(<AddAffiliation />)
     renderWithProjectListContext(<AddAffiliation />)
 
 
     await fetchMock.callHistory.flush(true)
     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)
     await screen.findByText(/are you affiliated with an institution/i)
     const addAffiliationLink = screen.getByRole('link', {
     const addAffiliationLink = screen.getByRole('link', {
@@ -44,7 +46,9 @@ describe('Add affiliation widget', function () {
     renderWithProjectListContext(<AddAffiliation />)
     renderWithProjectListContext(<AddAffiliation />)
 
 
     await fetchMock.callHistory.flush(true)
     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()
     validateNonExistence()
   })
   })
@@ -58,7 +62,9 @@ describe('Add affiliation widget', function () {
     })
     })
 
 
     await fetchMock.callHistory.flush(true)
     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()
     validateNonExistence()
   })
   })
@@ -70,7 +76,9 @@ describe('Add affiliation widget', function () {
     renderWithProjectListContext(<AddAffiliation />)
     renderWithProjectListContext(<AddAffiliation />)
 
 
     await fetchMock.callHistory.flush(true)
     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()
     validateNonExistence()
   })
   })

+ 13 - 7
services/web/test/frontend/features/project-list/components/sidebar/tags-list.test.tsx

@@ -34,7 +34,9 @@ describe('<TagsList />', function () {
     renderWithProjectListContext(<TagsList />)
     renderWithProjectListContext(<TagsList />)
 
 
     await fetchMock.callHistory.flush(true)
     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 () {
   afterEach(function () {
@@ -241,8 +243,10 @@ describe('<TagsList />', function () {
 
 
       fireEvent.click(saveButton)
       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(
       await waitFor(
@@ -286,8 +290,9 @@ describe('<TagsList />', function () {
       const deleteButton = within(modal).getByRole('button', { name: 'Delete' })
       const deleteButton = within(modal).getByRole('button', { name: 'Delete' })
       fireEvent.click(deleteButton)
       fireEvent.click(deleteButton)
 
 
-      await waitFor(() =>
-        expect(fetchMock.callHistory.called(`/tag/bcd234efg567`))
+      await waitFor(
+        () =>
+          expect(fetchMock.callHistory.called(`/tag/abc123def456`)).to.be.true
       )
       )
 
 
       await waitFor(
       await waitFor(
@@ -307,8 +312,9 @@ describe('<TagsList />', function () {
       const deleteButton = within(modal).getByRole('button', { name: 'Delete' })
       const deleteButton = within(modal).getByRole('button', { name: 'Delete' })
       fireEvent.click(deleteButton)
       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')
       await within(modal).findByText('Sorry, something went wrong')

+ 10 - 9
services/web/test/frontend/features/project-list/components/table/cells/inline-tags.test.tsx

@@ -58,15 +58,16 @@ describe('<InlineTags />', function () {
       name: 'Remove tag My Test Tag',
       name: 'Remove tag My Test Tag',
     })
     })
     fireEvent.click(removeButton)
     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
     expect(screen.queryByText('My Test Tag')).to.not.exist
     screen.getByText('Tag 2')
     screen.getByText('Tag 2')

+ 2 - 2
services/web/test/frontend/features/settings/components/linking/sso-widget.test.tsx

@@ -100,8 +100,8 @@ describe('<SSOLinkingWidget />', function () {
         })
         })
       )
       )
       fireEvent.click(confirmBtn)
       fireEvent.click(confirmBtn)
-      await waitFor(() =>
-        expect(screen.getByRole('button', { name: 'Unlinking' }))
+      await waitFor(
+        () => expect(screen.getByRole('button', { name: 'Unlinking' })).to.exist
       )
       )
     })
     })
   })
   })