Skip to content

Commit

Permalink
chore(boxai-sidebar): UT fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DanilaRubleuski committed Oct 10, 2024
1 parent 8f46b3e commit 23a7549
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/elements/content-sidebar/__tests__/BoxAISidebar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import { userEvent } from '@testing-library/user-event';
import { screen, render } from '../../../test-utils/testing-library';
import BoxAISidebarComponent, { BoxAISidebarProps } from '../BoxAISidebar';
import sidebarMessages from '../messages';

const mockOnExpandClick = jest.fn();

Expand All @@ -24,13 +23,13 @@ describe('elements/content-sidebar/BoxAISidebar', () => {
test('should have accessible "Expand" button', () => {
renderComponent();

expect(screen.getByRole('button', sidebarMessages.expandBoxAI)).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Expand' })).toBeInTheDocument();
});

test('should call onExpandClick when click "Expand" button', async () => {
renderComponent();

const expandButton = screen.getByRole('button', sidebarMessages.expandBoxAI);
const expandButton = screen.getByRole('button', { name: 'Expand' });
await userEvent.click(expandButton);

expect(mockOnExpandClick).toHaveBeenCalled();
Expand Down

0 comments on commit 23a7549

Please sign in to comment.