feat: Visualize SqlLab.Query model data in Explore 📈 (#20281)

This commit is contained in:
Hugh A. Miles II
2022-07-15 19:34:02 -04:00
committed by GitHub
parent c70d102b73
commit e5e8867394
61 changed files with 2510 additions and 610 deletions

View File

@@ -18,7 +18,11 @@
*/
import React from 'react';
import fetchMock from 'fetch-mock';
import { getChartControlPanelRegistry } from '@superset-ui/core';
import {
getChartControlPanelRegistry,
getChartMetadataRegistry,
ChartMetadata,
} from '@superset-ui/core';
import { MemoryRouter, Route } from 'react-router-dom';
import { render, screen, waitFor } from 'spec/helpers/testing-library';
import userEvent from '@testing-library/user-event';
@@ -94,6 +98,14 @@ const renderWithRouter = (withKey?: boolean) => {
};
test('generates a new form_data param when none is available', async () => {
getChartMetadataRegistry().registerValue(
'table',
new ChartMetadata({
name: 'fake table',
thumbnail: '.png',
useLegacyApi: false,
}),
);
const replaceState = jest.spyOn(window.history, 'replaceState');
await waitFor(() => renderWithRouter());
expect(replaceState).toHaveBeenCalledWith(