Skip to content

Commit

Permalink
UIEH-1408: Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro-Melnyshyn committed Mar 1, 2024
1 parent 68d8489 commit 3cca6cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/components/details-view/details-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ class DetailsView extends Component {
header={this.renderAccordionHeader}
headerProps={{
resultsLength,
'data-testid': `accordion-toggle-button-${listSectionId}`,
}}
label={(
<Headline
Expand Down
10 changes: 5 additions & 5 deletions src/components/package/show/package-show.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,19 +316,19 @@ describe('Given PackageShow', () => {
});

it('should call onToggleTitles', () => {
const { getByTestId } = renderPackageShow();
const { getByRole } = renderPackageShow();

fireEvent.click(getByTestId('accordion-toggle-button-packageShowTitles'));
fireEvent.click(getByTestId('accordion-toggle-button-packageShowTitles'));
fireEvent.click(getByRole('button', { name: 'ui-eholdings.listType.titles' }));
fireEvent.click(getByRole('button', { name: 'ui-eholdings.listType.titles' }));
expect(mockOnToggleTitles).toHaveBeenCalled();
});
});

describe('when closing', () => {
it('should not invoke onToggleTitles', () => {
const { getByTestId } = renderPackageShow();
const { getByRole } = renderPackageShow();

fireEvent.click(getByTestId('accordion-toggle-button-packageShowTitles'));
fireEvent.click(getByRole('button', { name: 'ui-eholdings.listType.titles' }));
expect(mockOnToggleTitles).not.toHaveBeenCalled();
});
});
Expand Down

0 comments on commit 3cca6cb

Please sign in to comment.