fix(ui): update popover label
parent
23acf06df2
commit
88fe9ca383
|
@ -1,4 +1,5 @@
|
|||
import {cleanup} from 'react-testing-library'
|
||||
import 'intersection-observer'
|
||||
|
||||
jest.mock('honeybadger-js', () => () => null)
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
import React from 'react'
|
||||
import {act} from 'react-dom/test-utils'
|
||||
import {fireEvent} from 'react-testing-library'
|
||||
import 'intersection-observer'
|
||||
|
||||
// Components
|
||||
import InlineLabelsEditor from 'src/shared/components/inlineLabels/InlineLabelsEditor'
|
||||
|
@ -64,11 +65,14 @@ describe('Shared.Components.InlineLabelsEditor', () => {
|
|||
})
|
||||
|
||||
describe('mouse interactions', () => {
|
||||
it('Clicking the plus button opens the popover', () => {
|
||||
it('hovering the plus button opens the popover', () => {
|
||||
const {getByTestId, getAllByTestId} = setup()
|
||||
|
||||
const plusButton = getByTestId('inline-labels--add')
|
||||
plusButton.click()
|
||||
|
||||
act(() => {
|
||||
plusButton.click()
|
||||
})
|
||||
|
||||
const popover = getAllByTestId('inline-labels--popover-field')
|
||||
|
||||
|
@ -79,8 +83,9 @@ describe('Shared.Components.InlineLabelsEditor', () => {
|
|||
const {getByTestId, getAllByTestId} = setup()
|
||||
|
||||
const plusButton = getByTestId('inline-labels--add')
|
||||
plusButton.click()
|
||||
|
||||
act(() => {
|
||||
plusButton.click()
|
||||
})
|
||||
const inputValue = 'yodelling is rad'
|
||||
|
||||
const input = getByTestId('inline-labels--popover-field')
|
||||
|
@ -103,8 +108,9 @@ describe('Shared.Components.InlineLabelsEditor', () => {
|
|||
const onAddLabel = jest.fn()
|
||||
const {getByTestId} = setup({onAddLabel})
|
||||
const button = getByTestId('inline-labels--add')
|
||||
button.click()
|
||||
|
||||
act(() => {
|
||||
button.click()
|
||||
})
|
||||
const secondListItem = getByTestId(`label-list--item ${secondLabel.name}`)
|
||||
fireEvent.click(secondListItem)
|
||||
|
||||
|
|
Loading…
Reference in New Issue