Skip to content

Commit 30472c2

Browse files
committed
test: update BulkSelect unit tests
1 parent 5f1cc53 commit 30472c2

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

packages/module/src/BulkSelect/BulkSelect.test.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { render, screen } from '@testing-library/react';
22
import userEvent from '@testing-library/user-event';
3-
import BulkSelect, { BulkSelectValue } from './BulkSelect';
3+
import BulkSelect, { BulkSelectSource, BulkSelectValue } from './BulkSelect';
44

55
describe('BulkSelect component', () => {
66
test('should render', () => {
@@ -101,7 +101,7 @@ describe('BulkSelect component', () => {
101101
expect(screen.getByText('Tout sélectionner (10)')).toBeInTheDocument();
102102
});
103103

104-
test('should call onSelect with source "dropdown" when choosing menu items', async () => {
104+
test(`should call onSelect with source ${BulkSelectSource.dropdown} when choosing menu items`, async () => {
105105
const user = userEvent.setup();
106106
const onSelect = jest.fn();
107107
render(
@@ -122,20 +122,20 @@ describe('BulkSelect component', () => {
122122

123123
await openMenu();
124124
await user.click(screen.getByRole('menuitem', { name: 'Select none (0)' }));
125-
expect(onSelect).toHaveBeenLastCalledWith(BulkSelectValue.none, 'dropdown');
125+
expect(onSelect).toHaveBeenLastCalledWith(BulkSelectValue.none, BulkSelectSource.dropdown);
126126

127127
onSelect.mockClear();
128128
await openMenu();
129129
await user.click(screen.getByRole('menuitem', { name: 'Select page (5)' }));
130-
expect(onSelect).toHaveBeenLastCalledWith(BulkSelectValue.page, 'dropdown');
130+
expect(onSelect).toHaveBeenLastCalledWith(BulkSelectValue.page, BulkSelectSource.dropdown);
131131

132132
onSelect.mockClear();
133133
await openMenu();
134134
await user.click(screen.getByRole('menuitem', { name: 'Select all (10)' }));
135-
expect(onSelect).toHaveBeenLastCalledWith(BulkSelectValue.all, 'dropdown');
135+
expect(onSelect).toHaveBeenLastCalledWith(BulkSelectValue.all, BulkSelectSource.dropdown);
136136
});
137137

138-
test('should call onSelect with source "checkbox" when using split checkbox', async () => {
138+
test(`should call onSelect with source ${BulkSelectSource.checkbox} when using split checkbox`, async () => {
139139
const user = userEvent.setup();
140140
const onSelect = jest.fn();
141141
render(
@@ -151,6 +151,6 @@ describe('BulkSelect component', () => {
151151
);
152152

153153
await user.click(screen.getByRole('checkbox', { name: 'Select page' }));
154-
expect(onSelect).toHaveBeenCalledWith(BulkSelectValue.page, 'checkbox');
154+
expect(onSelect).toHaveBeenCalledWith(BulkSelectValue.page, BulkSelectSource.checkbox);
155155
});
156156
});

0 commit comments

Comments
 (0)