fix(sqllab): Invalid schema fetch for deprecated value (#22695)

This commit is contained in:
JUST.in DO IT
2023-01-19 09:19:17 -08:00
committed by GitHub
parent 577ac81686
commit d591cc8082
8 changed files with 207 additions and 20 deletions

View File

@@ -43,6 +43,7 @@ const mockQueryEditor = {
autorun: false,
sql: 'SELECT * FROM ...',
remoteId: 999,
schemaOptions: [{ value: 'query_schema' }, { value: 'query_schema_updated' }],
};
const disabled = {
id: 'disabledEditorId',
@@ -82,6 +83,7 @@ const standardProviderWithUnsaved: React.FC = ({ children }) => (
...initialState,
sqlLab: {
...initialState.sqlLab,
queryEditors: [mockQueryEditor],
unsavedQueryEditor,
},
})}
@@ -123,7 +125,7 @@ describe('ShareSqlLabQuery', () => {
});
});
const button = screen.getByRole('button');
const { id, remoteId, ...expected } = mockQueryEditor;
const { id, remoteId, schemaOptions, ...expected } = mockQueryEditor;
const storeQuerySpy = jest.spyOn(utils, 'storeQuery');
userEvent.click(button);
expect(storeQuerySpy.mock.calls).toHaveLength(1);