mirror of
https://github.com/apache/superset.git
synced 2026-07-10 00:35:39 +00:00
feat(SIP-95): catalogs in SQL Lab and datasets (#28376)
This commit is contained in:
@@ -210,6 +210,38 @@ describe('SaveDatasetModal', () => {
|
||||
expect(createDatasource).toHaveBeenCalledWith({
|
||||
datasourceName: 'my dataset',
|
||||
dbId: 1,
|
||||
catalog: null,
|
||||
schema: 'main',
|
||||
sql: 'SELECT *',
|
||||
templateParams: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
it('sends the catalog when creating the dataset', async () => {
|
||||
const dummyDispatch = jest.fn().mockResolvedValue({});
|
||||
useDispatchMock.mockReturnValue(dummyDispatch);
|
||||
useSelectorMock.mockReturnValue({ ...user });
|
||||
|
||||
render(
|
||||
<SaveDatasetModal
|
||||
{...mockedProps}
|
||||
datasource={{ ...mockedProps.datasource, catalog: 'public' }}
|
||||
/>,
|
||||
{ useRedux: true },
|
||||
);
|
||||
|
||||
const inputFieldText = screen.getByDisplayValue(/unimportant/i);
|
||||
fireEvent.change(inputFieldText, { target: { value: 'my dataset' } });
|
||||
|
||||
const saveConfirmationBtn = screen.getByRole('button', {
|
||||
name: /save/i,
|
||||
});
|
||||
userEvent.click(saveConfirmationBtn);
|
||||
|
||||
expect(createDatasource).toHaveBeenCalledWith({
|
||||
datasourceName: 'my dataset',
|
||||
dbId: 1,
|
||||
catalog: 'public',
|
||||
schema: 'main',
|
||||
sql: 'SELECT *',
|
||||
templateParams: undefined,
|
||||
|
||||
Reference in New Issue
Block a user