mirror of
https://github.com/apache/superset.git
synced 2026-06-01 05:39:17 +00:00
chore(fe): replace deprecate aliased Jest matchers with corresponding substituents (#30355)
Signed-off-by: hainenber <dotronghai96@gmail.com> Co-authored-by: Evan Rusackas <evan@preset.io>
This commit is contained in:
@@ -108,9 +108,12 @@ test('Should have add button', async () => {
|
||||
expect(
|
||||
await screen.findByRole('button', { name: 'plus-large' }),
|
||||
).toBeInTheDocument();
|
||||
expect(props.onChange).toBeCalledTimes(0);
|
||||
expect(props.onChange).toHaveBeenCalledTimes(0);
|
||||
userEvent.click(screen.getByRole('button', { name: 'plus-large' }));
|
||||
expect(props.onChange).toBeCalledWith([{ key: 'hrYAZ5iBH' }, undefined]);
|
||||
expect(props.onChange).toHaveBeenCalledWith([
|
||||
{ key: 'hrYAZ5iBH' },
|
||||
undefined,
|
||||
]);
|
||||
});
|
||||
|
||||
test('Should have remove button', async () => {
|
||||
@@ -120,9 +123,9 @@ test('Should have remove button', async () => {
|
||||
expect(
|
||||
await screen.findByRole('button', { name: 'remove-item' }),
|
||||
).toBeInTheDocument();
|
||||
expect(props.onChange).toBeCalledTimes(0);
|
||||
expect(props.onChange).toHaveBeenCalledTimes(0);
|
||||
userEvent.click(screen.getByRole('button', { name: 'remove-item' }));
|
||||
expect(props.onChange).toBeCalledWith([]);
|
||||
expect(props.onChange).toHaveBeenCalledWith([]);
|
||||
});
|
||||
|
||||
test('Should have SortableDragger icon', async () => {
|
||||
@@ -136,7 +139,7 @@ test('Should call Control component', async () => {
|
||||
render(<CollectionControl {...props} />);
|
||||
|
||||
expect(await screen.findByTestId('TestControl')).toBeInTheDocument();
|
||||
expect(props.onChange).toBeCalledTimes(0);
|
||||
expect(props.onChange).toHaveBeenCalledTimes(0);
|
||||
userEvent.click(screen.getByTestId('TestControl'));
|
||||
expect(props.onChange).toBeCalledWith([{ key: 'hrYAZ5iBH' }]);
|
||||
expect(props.onChange).toHaveBeenCalledWith([{ key: 'hrYAZ5iBH' }]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user