Skip to content

Commit 4ab7794

Browse files
committed
Fix jest test
1 parent 1435b5c commit 4ab7794

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

labkey-ui-ehr/src/ParticipantHistory/SearchByIdPanel/SearchByIdPanel.test.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -888,23 +888,20 @@ describe('SearchByIdPanel', () => {
888888
fireEvent.change(textarea, { target: { value: 'ID123' } });
889889
fireEvent.click(updateButton);
890890

891-
// Should show "Searching..." while loading
891+
// Button should be disabled while loading
892892
await waitFor(() => {
893-
expect(screen.getByRole('button', { name: /searching/i })).toBeInTheDocument();
893+
expect(screen.getByRole('button', { name: /search by ids/i })).toBeDisabled();
894894
});
895895

896-
// Button should be disabled while loading
897-
expect(screen.getByRole('button', { name: /searching/i })).toBeDisabled();
898-
899896
// Resolve the promise
900897
resolvePromise!({
901898
resolved: [{ inputId: 'ID123', resolvedId: 'ID123', resolvedBy: 'direct', aliasType: null }],
902899
notFound: [],
903900
});
904901

905-
// Should return to "search by ids" after loading
902+
// Button should be re-enabled after loading
906903
await waitFor(() => {
907-
expect(screen.getByRole('button', { name: /search by ids/i })).toBeInTheDocument();
904+
expect(screen.getByRole('button', { name: /search by ids/i })).toBeEnabled();
908905
});
909906
});
910907
});

0 commit comments

Comments
 (0)