chore: Working toward killing enzyme and cleaning up test noise. (#32207)

This commit is contained in:
Evan Rusackas
2025-02-11 12:14:36 -07:00
committed by GitHub
parent d3b854a833
commit 319a860f23
238 changed files with 4167 additions and 6334 deletions

View File

@@ -26,9 +26,13 @@ import {
ThemeProvider,
isFeatureEnabled,
} from '@superset-ui/core';
import { render, screen, act, waitFor } from '@testing-library/react';
import '@testing-library/jest-dom';
import userEvent from '@testing-library/user-event';
import {
render,
screen,
act,
userEvent,
waitFor,
} from 'spec/helpers/testing-library';
import ShareSqlLabQuery from 'src/SqlLab/components/ShareSqlLabQuery';
import { initialState } from 'src/SqlLab/fixtures';
@@ -133,7 +137,7 @@ describe('ShareSqlLabQuery', () => {
});
});
const button = screen.getByRole('button');
const { id, remoteId, ...expected } = mockQueryEditor;
const { id: _id, remoteId: _remoteId, ...expected } = mockQueryEditor;
userEvent.click(button);
await waitFor(() =>
expect(fetchMock.calls(storeQueryUrl)).toHaveLength(1),
@@ -150,7 +154,7 @@ describe('ShareSqlLabQuery', () => {
});
});
const button = screen.getByRole('button');
const { id, ...expected } = unsavedQueryEditor;
const { id: _id, ...expected } = unsavedQueryEditor;
userEvent.click(button);
await waitFor(() =>
expect(fetchMock.calls(storeQueryUrl)).toHaveLength(1),