Skip to content

Commit

Permalink
Miscellaneous test fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Cormier <[email protected]>
  • Loading branch information
KevinFCormier committed Nov 13, 2024
1 parent 622bf2a commit 213bcff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ describe('ControlPanelLabels component', () => {
const Component = () => {
return <ControlPanelLabels key={'key'} control={control} controlId={'controlId'} handleChange={fn} i18n={t} />
}
const { getByTestId, asFragment, container } = render(<Component />)
const { getByTestId, getByRole, asFragment } = render(<Component />)
expect(asFragment()).toMatchSnapshot()

userEvent.type(getByTestId('controlId'), 'label=test{enter}')
expect(control.active).toEqual([{ key: 'label', value: 'test' }])
userEvent.type(getByTestId('controlId'), 'label=test2{enter}')
container.querySelector('.pf-v5-c-button').click()
userEvent.click(getByRole('button', { name: 'Close label=test' }))
expect(control.active).toEqual([])
userEvent.type(getByTestId('controlId'), 'label=test,')
userEvent.type(getByTestId('controlId'), 'label={esc}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,14 @@ const mockClusterImageSet0: ClusterImageSetK8sResource = {
}

const resultPending = {
icon: (
<Icon size="sm">
<InProgressIcon color="currentColor" />
</Icon>
),
icon: <InProgressIcon />,
text: 'Not ready',
type: 'pending',
}

const resultOK = {
icon: (
<Icon size="sm" status="success">
<Icon status="success">
<CheckCircleIcon />
</Icon>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -815,12 +815,11 @@ describe('NodePoolsTable', () => {
expect(screen.queryAllByText('Node pool name').length).toBe(1)
await waitForText('Cancel')
userEvent.click(screen.getByTestId('cancel-nodepool-form'))
expect(screen.queryAllByTestId(/pf-dropdown-toggle-id-[0-9]*/)[0]).toBeTruthy()
userEvent.click(screen.queryAllByTestId(/pf-dropdown-toggle-id-[0-9]*/)[0])
userEvent.click(screen.getAllByLabelText('Actions')[0])
userEvent.click(screen.getByText('Manage node pool'))
expect(screen.queryAllByText('Manage node pool').length).toBe(1)
userEvent.click(screen.getByTestId('cancel-nodepool-form'))
userEvent.click(screen.queryAllByTestId(/pf-dropdown-toggle-id-[0-9]*/)[0])
userEvent.click(screen.getAllByLabelText('Actions')[0])
userEvent.click(screen.getByText('Remove node pool'))
userEvent.click(screen.getByText('Cancel'))
})
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/ui-components/AcmSelect/AcmSelect.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('AcmSelect', () => {
)
}
const { container } = render(<TypeaheadSelect />)
expect(container.querySelector<HTMLInputElement>('.pf-v5-c-select__toggle-typeahead')).toHaveAttribute(
expect(container.querySelector<HTMLInputElement>('.pf-v5-c-select__toggle-typeahead input')).toHaveAttribute(
'placeholder',
'Select one'
)
Expand Down

0 comments on commit 213bcff

Please sign in to comment.