fix(ui): update popover label

pull/16185/head
Zoe Steinkamp 2020-01-09 10:10:25 -07:00
parent 23acf06df2
commit 88fe9ca383
2 changed files with 13 additions and 6 deletions

View File

@ -1,4 +1,5 @@
import {cleanup} from 'react-testing-library'
import 'intersection-observer'
jest.mock('honeybadger-js', () => () => null)

View File

@ -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')
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')
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')
act(() => {
button.click()
})
const secondListItem = getByTestId(`label-list--item ${secondLabel.name}`)
fireEvent.click(secondListItem)