chore: helpers required for dashboards e2e test cases (#5496)

* chore: helpers required for dashboards e2e test cases

* chore: helpers required for dashboards e2e test cases

* chore: helpers required for dashboards e2e test cases
This commit is contained in:
Vikrant Gupta 2024-07-16 18:35:59 +05:30 committed by GitHub
parent 840d8b2e49
commit 43e73e06fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 20 additions and 3 deletions

View File

@ -234,6 +234,7 @@ function WidgetHeader({
)}
<Dropdown menu={menu} trigger={['hover']} placement="bottomRight">
<MoreOutlined
data-testid="widget-header-options"
className={`widget-header-more-options ${
parentHover ? 'widget-header-hover' : ''
}`}

View File

@ -411,7 +411,12 @@ function DashboardDescription(props: DashboardDescriptionProps): JSX.Element {
trigger="click"
placement="bottomRight"
>
<Button icon={<Ellipsis size={14} />} type="text" className="icons" />
<Button
icon={<Ellipsis size={14} />}
type="text"
className="icons"
data-testid="options"
/>
</Popover>
{!isDashboardLocked && editDashboard && (
<SettingsDrawer drawerTitle="Dashboard Configuration" />
@ -422,7 +427,7 @@ function DashboardDescription(props: DashboardDescriptionProps): JSX.Element {
onClick={onEmptyWidgetHandler}
icon={<PlusOutlined />}
type="primary"
data-testid="add-panel"
data-testid="add-panel-header"
>
New Panel
</Button>

View File

@ -163,6 +163,7 @@ function RightContainer({
value={selectedGraph}
style={{ width: '100%' }}
className="panel-type-select"
data-testid="panel-change-select"
>
{graphTypes.map((item) => (
<Option key={item.name} value={item.name}>

View File

@ -563,7 +563,12 @@ function NewWidget({ selectedGraph }: NewWidgetProps): JSX.Element {
<Container>
<div className="edit-header">
<div className="left-header">
<X size={14} onClick={onClickDiscardHandler} className="discard-icon" />
<X
size={14}
onClick={onClickDiscardHandler}
className="discard-icon"
data-testid="discard-button"
/>
<Flex align="center" gap={24}>
<Typography.Text className="configure-panel">
Configure panel

View File

@ -216,6 +216,7 @@ export const panelTypeDataSourceFormValuesMap: Record<
'queryName',
'expression',
'disabled',
'reduceTo',
'legend',
],
},
@ -235,6 +236,7 @@ export const panelTypeDataSourceFormValuesMap: Record<
'queryName',
'expression',
'disabled',
'reduceTo',
'legend',
],
},
@ -252,6 +254,7 @@ export const panelTypeDataSourceFormValuesMap: Record<
'queryName',
'expression',
'disabled',
'reduceTo',
'legend',
],
},

View File

@ -191,6 +191,7 @@ export const GroupByFilter = memo(function GroupByFilter({
labelInValue
notFoundContent={isFetching ? <Spin size="small" /> : null}
onChange={handleChange}
data-testid="group-by"
/>
);
});

View File

@ -27,6 +27,7 @@ export const ReduceToFilter = memo(function ReduceToFilter({
style={{ width: '100%' }}
options={REDUCE_TO_VALUES}
value={currentValue}
data-testid="reduce-to"
labelInValue
onChange={handleChange}
/>