From 296ff17f196084dbfe1fc5745c2f0e429325aa11 Mon Sep 17 00:00:00 2001
From: Jack <41238731+fisjac@users.noreply.github.com>
Date: Tue, 26 Sep 2023 13:41:28 -0500
Subject: [PATCH] fix: preventing save button from flickering in SQL Lab
(#25106)
---
.../components/SaveQuery/SaveQuery.test.tsx | 21 ++++++++++++++++++-
.../src/SqlLab/components/SaveQuery/index.tsx | 12 +++++++----
2 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx b/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx
index f321a54ec4dbe..54b81df96013d 100644
--- a/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx
+++ b/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx
@@ -27,7 +27,7 @@ import { initialState, databases } from 'src/SqlLab/fixtures';
const mockedProps = {
queryEditorId: '123',
animation: false,
- database: databases.result[0],
+ database: { ...databases.result[0], allows_virtual_table_explore: false },
onUpdate: () => {},
onSave: () => {},
saveQueryWarning: null,
@@ -61,6 +61,25 @@ const middlewares = [thunk];
const mockStore = configureStore(middlewares);
describe('SavedQuery', () => {
+ it('doesnt render save button when allows_virtual_table_explore is undefined', async () => {
+ const noRenderProps = {
+ ...mockedProps,
+ database: {
+ ...mockedProps.database,
+ allows_virtual_table_explore: undefined,
+ },
+ };
+ render(