diff --git a/packages/react/src/components/CardEditor/CardEditor.test.jsx b/packages/react/src/components/CardEditor/CardEditor.test.jsx index 3ce5be192c..3c206e5a8d 100644 --- a/packages/react/src/components/CardEditor/CardEditor.test.jsx +++ b/packages/react/src/components/CardEditor/CardEditor.test.jsx @@ -107,7 +107,7 @@ describe('CardEditor', () => { title: `${defaultCard.title}z`, }); actions.onChange.mockReset(); - userEvent.click(screen.getByRole('button', { name: 'Size Small (4x1)' })); + userEvent.click(screen.getByRole('combobox', { name: 'Size Small (4x1)' })); userEvent.click(screen.getByText('Medium wide (16x2)')); expect(actions.onChange).toHaveBeenCalledWith({ ...defaultCard, diff --git a/packages/react/src/components/HotspotEditorModal/HotspotTextStyleTab/HotspotTextStyleTab.test.jsx b/packages/react/src/components/HotspotEditorModal/HotspotTextStyleTab/HotspotTextStyleTab.test.jsx index e868576536..3657f98ffa 100644 --- a/packages/react/src/components/HotspotEditorModal/HotspotTextStyleTab/HotspotTextStyleTab.test.jsx +++ b/packages/react/src/components/HotspotEditorModal/HotspotTextStyleTab/HotspotTextStyleTab.test.jsx @@ -61,7 +61,7 @@ describe('HotspotTextStyleTab', () => { expect(screen.getByTestId('hotspot-italic')).toBeDisabled(); expect(screen.getByTestId('hotspot-underline')).toBeDisabled(); - expect(screen.getByRole('button', { name: 'Font color Select a color' })).toBeDisabled(); + expect(screen.getByRole('combobox', { name: 'Font color Select a color' })).toBeDisabled(); expect(screen.getByRole('spinbutton', { name: 'Font Size' })).toBeDisabled(); }); diff --git a/packages/react/src/components/OverflowMenu/OverflowMenu.test.jsx b/packages/react/src/components/OverflowMenu/OverflowMenu.test.jsx index ece7f72503..f6573c7060 100644 --- a/packages/react/src/components/OverflowMenu/OverflowMenu.test.jsx +++ b/packages/react/src/components/OverflowMenu/OverflowMenu.test.jsx @@ -28,7 +28,7 @@ describe('OverflowMenu', () => { ); userEvent.click( - screen.getByLabelText('open and close list of options', { selector: 'button' }) + screen.getByLabelText('Open and close list of options', { selector: 'button' }) ); userEvent.click(screen.getByText('Option 1')); expect(onClick).toHaveBeenCalled(); @@ -77,7 +77,7 @@ describe('IotOverflowMenu', () => { ); - expect(screen.getByLabelText('open and close list of options')).toBeDefined(); + expect(screen.getByLabelText('Open and close list of options')).toBeDefined(); expect(screen.getByTestId(testId).querySelector('svg')).toBeDefined(); }); diff --git a/packages/react/src/components/RuleBuilder/RuleBuilder.test.jsx b/packages/react/src/components/RuleBuilder/RuleBuilder.test.jsx index 824b63d5ba..51d155467a 100644 --- a/packages/react/src/components/RuleBuilder/RuleBuilder.test.jsx +++ b/packages/react/src/components/RuleBuilder/RuleBuilder.test.jsx @@ -155,9 +155,7 @@ describe('The RuleBuilder', () => { expect(screen.getByTestId('rule-builder')).toBeInTheDocument(); expect(screen.getByRole('button', { name: 'Save' })).toBeInTheDocument(); - // one for edit modal, read modal, and main page cancel - expect(screen.getAllByRole('button', { name: 'Cancel' })).toHaveLength(3); - expect(screen.getAllByRole('button', { name: 'Cancel' })[0]).toBeInTheDocument(); + expect(screen.getByRole('button', { name: 'Cancel' })).toBeInTheDocument(); expect(screen.getByRole('button', { name: 'Preview results' })).toBeInTheDocument(); expect(screen.getByRole('button', { name: 'Apply' })).toBeInTheDocument(); expect(screen.getByRole('button', { name: 'Share' })).toBeInTheDocument();