From b3d7c56e64f6c8cd61bd2acefeb05efea4d399b7 Mon Sep 17 00:00:00 2001 From: Midhun Kumar E Date: Wed, 20 Sep 2023 11:54:59 +0530 Subject: [PATCH] Add data-cy for query manager regression and smoke. (#7460) * Add missing data-cy * Add mising data-cy --- .../Components/DataSourcePicker.jsx | 11 +++++++--- .../Components/DataSourceSelect.jsx | 22 +++++++++++++++---- .../Editor/QueryPanel/FilterandSortPopup.jsx | 6 ++++- .../src/Editor/QueryPanel/QueryDataPane.jsx | 2 +- 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/frontend/src/Editor/QueryManager/Components/DataSourcePicker.jsx b/frontend/src/Editor/QueryManager/Components/DataSourcePicker.jsx index af84f80cb6..e59db2b03c 100644 --- a/frontend/src/Editor/QueryManager/Components/DataSourcePicker.jsx +++ b/frontend/src/Editor/QueryManager/Components/DataSourcePicker.jsx @@ -52,10 +52,15 @@ function DataSourcePicker({ dataSources, staticDataSources, darkMode, globalData

Connect to a data source

-

+

Select a data source to start creating a new query. To know more about queries in ToolJet, you can read our   - + documentation

@@ -143,7 +148,7 @@ const EmptyDataSourceBanner = () => (
-
No global data sources have been added yet.
+
No global data sources have been added yet.
); diff --git a/frontend/src/Editor/QueryManager/Components/DataSourceSelect.jsx b/frontend/src/Editor/QueryManager/Components/DataSourceSelect.jsx index 0cc5ce8ec0..262415a9cc 100644 --- a/frontend/src/Editor/QueryManager/Components/DataSourceSelect.jsx +++ b/frontend/src/Editor/QueryManager/Components/DataSourceSelect.jsx @@ -52,7 +52,11 @@ function DataSourceSelect({ isDisabled, selectRef, closePopup }) { label: (
{index === 0 && ( -
+
Global data sources
)} @@ -66,6 +70,7 @@ function DataSourceSelect({ isDisabled, selectRef, closePopup }) { className="py-2 px-2 rounded option-nested-datasource-selector small text-truncate" data-tooltip-id="tooltip-for-add-query-dd-option" data-tooltip-content={source.name} + data-cy={`ds-${source.name.toLowerCase()}`} > {source.name} @@ -83,7 +88,7 @@ function DataSourceSelect({ isDisabled, selectRef, closePopup }) { const DataSourceOptions = [ { label: ( - + Defaults ), @@ -92,7 +97,10 @@ function DataSourceSelect({ isDisabled, selectRef, closePopup }) { ...staticDataSources.map((source) => ({ label: (
- {source.name} + {' '} + + {source.name} +
), value: source.id, @@ -245,7 +253,13 @@ const MenuList = ({ children, getStyles, innerRef, ...props }) => {
{admin && (
- + + Add new data source
diff --git a/frontend/src/Editor/QueryPanel/FilterandSortPopup.jsx b/frontend/src/Editor/QueryPanel/FilterandSortPopup.jsx index bc98851d6a..ec4da75de2 100644 --- a/frontend/src/Editor/QueryPanel/FilterandSortPopup.jsx +++ b/frontend/src/Editor/QueryPanel/FilterandSortPopup.jsx @@ -259,6 +259,7 @@ const DataSourceSelector = ({ onChange={(e) => setSearch(e.target.value)} ref={searchBoxRef} value={search} + data-cy="input-query-ds-filter" />
@@ -279,7 +280,10 @@ const DataSourceSelector = ({ label={
-  {source.name} +   + + {source.name} +
} /> diff --git a/frontend/src/Editor/QueryPanel/QueryDataPane.jsx b/frontend/src/Editor/QueryPanel/QueryDataPane.jsx index f87882b116..990f813af7 100644 --- a/frontend/src/Editor/QueryPanel/QueryDataPane.jsx +++ b/frontend/src/Editor/QueryPanel/QueryDataPane.jsx @@ -202,7 +202,7 @@ const EmptyDataSource = () => ( - No queries have been added. + No queries have been added. );