Skip to content

Commit

Permalink
test: fix testcases after package bump II
Browse files Browse the repository at this point in the history
  • Loading branch information
herleraja committed Apr 19, 2024
1 parent ed6b729 commit d59e081
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -77,7 +77,7 @@ describe('IotOverflowMenu', () => {
</OverflowMenu>
);

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();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d59e081

Please sign in to comment.