Skip to content

Commit 15dc1e1

Browse files
committed
test: update BulkSelect unit tests
1 parent 5061bfa commit 15dc1e1

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', () => {
@@ -141,7 +141,7 @@ describe('BulkSelect component', () => {
141141
expect(screen.getByRole('menuitem', { name: 'Select none (0)' })).not.toBeDisabled();
142142
});
143143

144-
test('should call onSelect with source "dropdown" when choosing menu items', async () => {
144+
test(`should call onSelect with source ${BulkSelectSource.dropdown} when choosing menu items`, async () => {
145145
const user = userEvent.setup();
146146
const onSelect = jest.fn();
147147

@@ -163,20 +163,20 @@ describe('BulkSelect component', () => {
163163

164164
await openMenu();
165165
await user.click(screen.getByRole('menuitem', { name: 'Select none (0)' }));
166-
expect(onSelect).toHaveBeenLastCalledWith(BulkSelectValue.none, 'dropdown');
166+
expect(onSelect).toHaveBeenLastCalledWith(BulkSelectValue.none, BulkSelectSource.dropdown);
167167

168168
onSelect.mockClear();
169169
await openMenu();
170170
await user.click(screen.getByRole('menuitem', { name: 'Select page (5)' }));
171-
expect(onSelect).toHaveBeenLastCalledWith(BulkSelectValue.page, 'dropdown');
171+
expect(onSelect).toHaveBeenLastCalledWith(BulkSelectValue.page, BulkSelectSource.dropdown);
172172

173173
onSelect.mockClear();
174174
await openMenu();
175175
await user.click(screen.getByRole('menuitem', { name: 'Select all (10)' }));
176-
expect(onSelect).toHaveBeenLastCalledWith(BulkSelectValue.all, 'dropdown');
176+
expect(onSelect).toHaveBeenLastCalledWith(BulkSelectValue.all, BulkSelectSource.dropdown);
177177
});
178178

179-
test('should call onSelect with source "checkbox" when using split checkbox', async () => {
179+
test(`should call onSelect with source ${BulkSelectSource.checkbox} when using split checkbox`, async () => {
180180
const user = userEvent.setup();
181181
const onSelect = jest.fn();
182182
render(
@@ -192,6 +192,6 @@ describe('BulkSelect component', () => {
192192
);
193193

194194
await user.click(screen.getByRole('checkbox', { name: 'Select page' }));
195-
expect(onSelect).toHaveBeenCalledWith(BulkSelectValue.page, 'checkbox');
195+
expect(onSelect).toHaveBeenCalledWith(BulkSelectValue.page, BulkSelectSource.checkbox);
196196
});
197197
});

0 commit comments

Comments
 (0)