Skip to content

Commit

Permalink
chore: upgrade ariakit to v0.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
gnapse committed Aug 9, 2024
1 parent ca0c3ec commit 86e219f
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 72 deletions.
106 changes: 53 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"webpack": "^4.43.0"
},
"dependencies": {
"@ariakit/react": "^0.3.14",
"@ariakit/react": "0.4.5",
"aria-hidden": "^1.2.1",
"dayjs": "^1.8.10",
"patch-package": "^6.4.6",
Expand Down
21 changes: 3 additions & 18 deletions src/tooltip/tooltip.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { render, screen, act, waitFor } from '@testing-library/react'
import { render, screen, act } from '@testing-library/react'
import { axe } from 'jest-axe'
import userEvent from '@testing-library/user-event'
import { Tooltip } from './tooltip'
Expand Down Expand Up @@ -91,6 +91,7 @@ describe('Tooltip', () => {
})

it('can render content generated by a function only called when needed', async () => {
jest.useFakeTimers()
const content = jest.fn(() => 'tooltip content generated dynamically')
render(
<Tooltip content={content}>
Expand All @@ -115,6 +116,7 @@ describe('Tooltip', () => {
await flushMicrotasks()

expect(content).toHaveBeenCalled()
jest.useRealTimers()
})

/**
Expand Down Expand Up @@ -204,23 +206,6 @@ describe('Tooltip', () => {
})
})

it('sets the tooltip content as the trigger element’s accessible description', async () => {
render(
<Tooltip content="tooltip content here">
<button>Click me</button>
</Tooltip>,
)

// Since the content is only rendered when the tooltip appears, this description is only
// available when we hover or focus the button, and not before.
const button = screen.getByRole('button', { name: 'Click me' })
userEvent.tab()

await waitFor(() => {
expect(button).toHaveAccessibleDescription('tooltip content here')
})
})

it('does not acknowledge the className prop, but exceptionallySetClassName instead', async () => {
render(
<Tooltip
Expand Down

0 comments on commit 86e219f

Please sign in to comment.