Skip to content

Commit

Permalink
click confirm buttons in test
Browse files Browse the repository at this point in the history
  • Loading branch information
theosanderson authored Feb 27, 2024
1 parent b21fd94 commit 2a3b5fd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions website/src/components/ReviewPage/ReviewPage.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ describe('ReviewPage', () => {
expect(getByText(awaitingApprovalTestData.accession)).toBeDefined();
});



getByText('Discard sequences').click();

await waitFor(() => {
Expand All @@ -124,7 +126,9 @@ describe('ReviewPage', () => {
mockRequest.backend.getSequences(200, generateGetSequencesResponse([]));

getByText((text) => text.includes('Discard 1 sequences with errors')).click();
getByText((text) => text.includes('Confirm')).click();

Check failure on line 129 in website/src/components/ReviewPage/ReviewPage.spec.tsx

View workflow job for this annotation

GitHub Actions / Unit Tests

src/components/ReviewPage/ReviewPage.spec.tsx > ReviewPage > should render the review page and show button to bulk delete/approve all erroneous sequences

TestingLibraryElementError: Unable to find an element with the text: (text) => text.includes("Confirm"). This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. Ignored nodes: comments, script, style <body class="react-confirm-alert-body-element" > <div class="react-confirm-alert-blur" > <div class="flex flex-col py-2" > <div> 2 of 2 sequences processed. </div> <div> <input checked="" class="mr-3" title="Show sequences with errors" type="checkbox" /> Show Errors </div> </div> <div class="flex justify-end items-center gap-3" > <div class="relative inline-block text-left" data-headlessui-state="open" > <button aria-controls="headlessui-menu-items-:r1:" aria-expanded="true" aria-haspopup="menu" class="border rounded-md p-1 bg-gray-500 text-white px-2" data-headlessui-state="open" id="headlessui-menu-button-:r0:" type="button" > <svg class="inline-block w-4 h-4 -mt-0.5 mr-1.5" height="1.2em" viewBox="0 0 16 16" width="1.2em" > <g fill="currentColor" > <path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z" /> <path d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4L4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z" /> </g> </svg> Discard sequences <svg class="inline-block ml-1 w-3 h-3 -mt-0.5" height="1.2em" viewBox="0 0 40 40" width="1.2em" > <path d="M4.659 11.833h30.682L20 32.167z" fill="currentColor" /> </svg> </button> <div aria-labelledby="headlessui-menu-button-:r0:" class="origin-top-right absolute z-50 bg-white" data-headlessui-state="open" id="headlessui-menu-items-:r1:" role="menu" tabindex="0" > <div class="py-1" role="none" > <button class="group flex rounded-md items-center w-full px-2 py-2 text-sm hover:bg-gray-400 bg-gray-500 text-white text-left mb-1" data-headlessui-state="" id="headlessui-menu-item-:r2:" role="menuitem" tabindex="-1" > <svg class="inline-block w-4 h-4 -mt-0.5 mr-1.5" height="1.2em" viewBox="0 0 16 16" width="1.2em" > <g fill="currentColor" > <path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5m3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0z" /> <path d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1zM4.118 4L4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4zM2.5 3h11V2h-11z" /> </g> </svg> Discard 1 sequences with errors </button> <button class="group flex rounded-md items-center w-full px-2 py-2 text-sm hover:bg-gray-400 bg-gray-500 text-white text-left mb-1" data-headless
getByText((text) => text.includes('Release 1 sequences without errors')).click();
getByText((text) => text.includes('Confirm')).click();

await waitFor(() => {
expect(getByText('No sequences to review')).toBeDefined();
Expand Down

0 comments on commit 2a3b5fd

Please sign in to comment.