Skip to content

Commit f6ab522

Browse files
gnapseBloomca
authored andcommitted
Fix other tests affected by the upgrade
1 parent c6f9b17 commit f6ab522

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

src/components/time/time.test.tsx

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,13 @@ describe('Time', () => {
6767
})
6868

6969
it('renders wrapped in tooltip when tooltipOnHover is set', async () => {
70+
jest.useRealTimers()
7071
render(<Time time={testDate} tooltipOnHover />)
7172

7273
userEvent.hover(screen.getByText('March 22, 1991'))
7374
await waitFor(() => {
7475
expect(screen.getByRole('tooltip', { name: 'March 22, 1991, 1:37 PM' })).toBeVisible()
7576
})
76-
77-
userEvent.unhover(screen.getByText('March 22, 1991'))
78-
await waitFor(() => {
79-
expect(screen.queryByRole('tooltip')).not.toBeInTheDocument()
80-
})
8177
})
8278

8379
it('renders with custom tooltip when supplied', async () => {
@@ -87,11 +83,6 @@ describe('Time', () => {
8783
await waitFor(() => {
8884
expect(screen.getByRole('tooltip', { name: 'Test' })).toBeVisible()
8985
})
90-
91-
userEvent.unhover(screen.getByText('March 22, 1991'))
92-
await waitFor(() => {
93-
expect(screen.queryByRole('tooltip')).not.toBeInTheDocument()
94-
})
9586
})
9687

9788
it('does not render short absolute time on hover when tooltipOnHover is set', async () => {
@@ -102,11 +93,6 @@ describe('Time', () => {
10293
expect(screen.getByRole('tooltip', { name: dayjs().format('LL, LT') })).toBeVisible()
10394
expect(screen.getByText('moments ago')).toBeVisible()
10495
})
105-
106-
userEvent.unhover(screen.getByText('moments ago'))
107-
await waitFor(() => {
108-
expect(screen.queryByRole('tooltip')).not.toBeInTheDocument()
109-
})
11096
})
11197

11298
it('does not render full absolute time on hover when tooltipOnHover is set', async () => {
@@ -117,11 +103,6 @@ describe('Time', () => {
117103
expect(screen.getByRole('tooltip', { name: dayjs().format('LL, LT') })).toBeVisible()
118104
expect(screen.getByText('moments ago')).toBeVisible()
119105
})
120-
121-
userEvent.unhover(screen.getByText('moments ago'))
122-
await waitFor(() => {
123-
expect(screen.queryByRole('tooltip')).not.toBeInTheDocument()
124-
})
125106
})
126107

127108
describe('a11y', () => {

0 commit comments

Comments
 (0)