mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 17:08:34 +00:00
Add data-cy for query manager regression and smoke. (#7460)
* Add missing data-cy * Add mising data-cy
This commit is contained in:
parent
a6bfc57c3e
commit
b3d7c56e64
4 changed files with 32 additions and 9 deletions
|
|
@ -52,10 +52,15 @@ function DataSourcePicker({ dataSources, staticDataSources, darkMode, globalData
|
||||||
<h4 className="w-100 text-center" data-cy={'label-select-datasource'} style={{ fontWeight: 500 }}>
|
<h4 className="w-100 text-center" data-cy={'label-select-datasource'} style={{ fontWeight: 500 }}>
|
||||||
Connect to a data source
|
Connect to a data source
|
||||||
</h4>
|
</h4>
|
||||||
<p className="mb-3" style={{ textAlign: 'center' }}>
|
<p className="mb-3" style={{ textAlign: 'center' }} data-cy="querymanager-description">
|
||||||
Select a data source to start creating a new query. To know more about queries in ToolJet, you can read our
|
Select a data source to start creating a new query. To know more about queries in ToolJet, you can read our
|
||||||
|
|
||||||
<a target="_blank" href="https://docs.tooljet.com/docs/app-builder/query-panel" rel="noreferrer">
|
<a
|
||||||
|
data-cy="querymanager-doc-link"
|
||||||
|
target="_blank"
|
||||||
|
href="https://docs.tooljet.com/docs/app-builder/query-panel"
|
||||||
|
rel="noreferrer"
|
||||||
|
>
|
||||||
documentation
|
documentation
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -143,7 +148,7 @@ const EmptyDataSourceBanner = () => (
|
||||||
<div className="me-2">
|
<div className="me-2">
|
||||||
<Information fill="var(--slate9)" />
|
<Information fill="var(--slate9)" />
|
||||||
</div>
|
</div>
|
||||||
<div>No global data sources have been added yet.</div>
|
<div data-cy="label-no-ds-added">No global data sources have been added yet.</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,11 @@ function DataSourceSelect({ isDisabled, selectRef, closePopup }) {
|
||||||
label: (
|
label: (
|
||||||
<div>
|
<div>
|
||||||
{index === 0 && (
|
{index === 0 && (
|
||||||
<div className="color-slate9 mb-2 pb-1" style={{ fontWeight: 500, marginTop: '-8px' }}>
|
<div
|
||||||
|
data-cy="ds-section-header-gds"
|
||||||
|
className="color-slate9 mb-2 pb-1"
|
||||||
|
style={{ fontWeight: 500, marginTop: '-8px' }}
|
||||||
|
>
|
||||||
Global data sources
|
Global data sources
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
@ -66,6 +70,7 @@ function DataSourceSelect({ isDisabled, selectRef, closePopup }) {
|
||||||
className="py-2 px-2 rounded option-nested-datasource-selector small text-truncate"
|
className="py-2 px-2 rounded option-nested-datasource-selector small text-truncate"
|
||||||
data-tooltip-id="tooltip-for-add-query-dd-option"
|
data-tooltip-id="tooltip-for-add-query-dd-option"
|
||||||
data-tooltip-content={source.name}
|
data-tooltip-content={source.name}
|
||||||
|
data-cy={`ds-${source.name.toLowerCase()}`}
|
||||||
>
|
>
|
||||||
{source.name}
|
{source.name}
|
||||||
<Tooltip id="tooltip-for-add-query-dd-option" className="tooltip query-manager-ds-select-tooltip" />
|
<Tooltip id="tooltip-for-add-query-dd-option" className="tooltip query-manager-ds-select-tooltip" />
|
||||||
|
|
@ -83,7 +88,7 @@ function DataSourceSelect({ isDisabled, selectRef, closePopup }) {
|
||||||
const DataSourceOptions = [
|
const DataSourceOptions = [
|
||||||
{
|
{
|
||||||
label: (
|
label: (
|
||||||
<span className="color-slate9" style={{ fontWeight: 500 }}>
|
<span data-cy="ds-section-header-default" className="color-slate9" style={{ fontWeight: 500 }}>
|
||||||
Defaults
|
Defaults
|
||||||
</span>
|
</span>
|
||||||
),
|
),
|
||||||
|
|
@ -92,7 +97,10 @@ function DataSourceSelect({ isDisabled, selectRef, closePopup }) {
|
||||||
...staticDataSources.map((source) => ({
|
...staticDataSources.map((source) => ({
|
||||||
label: (
|
label: (
|
||||||
<div>
|
<div>
|
||||||
<DataSourceIcon source={source} height={16} /> <span className="ms-1 small">{source.name}</span>
|
<DataSourceIcon source={source} height={16} />{' '}
|
||||||
|
<span data-cy={`ds-${source.name.toLowerCase()}`} className="ms-1 small">
|
||||||
|
{source.name}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
value: source.id,
|
value: source.id,
|
||||||
|
|
@ -245,7 +253,13 @@ const MenuList = ({ children, getStyles, innerRef, ...props }) => {
|
||||||
</div>
|
</div>
|
||||||
{admin && (
|
{admin && (
|
||||||
<div className="p-2 mt-2 border-slate3-top">
|
<div className="p-2 mt-2 border-slate3-top">
|
||||||
<ButtonSolid variant="secondary" size="md" className="w-100" onClick={handleAddClick}>
|
<ButtonSolid
|
||||||
|
variant="secondary"
|
||||||
|
size="md"
|
||||||
|
className="w-100"
|
||||||
|
onClick={handleAddClick}
|
||||||
|
data-cy="button-add-ds-dropdown"
|
||||||
|
>
|
||||||
+ Add new data source
|
+ Add new data source
|
||||||
</ButtonSolid>
|
</ButtonSolid>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -259,6 +259,7 @@ const DataSourceSelector = ({
|
||||||
onChange={(e) => setSearch(e.target.value)}
|
onChange={(e) => setSearch(e.target.value)}
|
||||||
ref={searchBoxRef}
|
ref={searchBoxRef}
|
||||||
value={search}
|
value={search}
|
||||||
|
data-cy="input-query-ds-filter"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -279,7 +280,10 @@ const DataSourceSelector = ({
|
||||||
label={
|
label={
|
||||||
<div className="d-flex align-items-center">
|
<div className="d-flex align-items-center">
|
||||||
<DataSourceIcon source={source} height={12} styles={{ minWidth: 12 }} />
|
<DataSourceIcon source={source} height={12} styles={{ minWidth: 12 }} />
|
||||||
<span className="ms-1 text-truncate">{source.name}</span>
|
|
||||||
|
<span className="ms-1 text-truncate" data-cy={`ds-filter-${source.name.toLowerCase()}`}>
|
||||||
|
{source.name}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@ const EmptyDataSource = () => (
|
||||||
<FolderEmpty style={{ height: '16px' }} />
|
<FolderEmpty style={{ height: '16px' }} />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<span>No queries have been added. </span>
|
<span data-cy="label-no-queries">No queries have been added. </span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue