|
|
@@ -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()
|
|
|
})
|