Skip to content

Commit

Permalink
Fix Copyable tooltip spec
Browse files Browse the repository at this point in the history
  • Loading branch information
stephl3 committed Oct 25, 2024
1 parent 6c50a53 commit 979fa9f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/copyable/src/Copyable/Copyable.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ describe('packages/copyable', () => {
},
);

await waitFor(() => expect(getByText('Copied!')).toBeVisible());
const tooltip = getByText('Copied!');

// Tooltip should remain visible for a while
await waitFor(() => expect(tooltip).toBeVisible());

await new Promise(resolve => setTimeout(resolve, 1000));
expect(getByText('Copied!')).toBeVisible();

// Tooltip should eventually disappear
await waitForElementToBeRemoved(() => queryByText('Copied!'));
await waitFor(() => expect(tooltip).not.toBeVisible());
},
);
});
Expand Down

0 comments on commit 979fa9f

Please sign in to comment.