mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboards: relabel add query button (#73607)
This commit is contained in:
parent
35818fa9ab
commit
53867e3fcd
@ -2859,8 +2859,7 @@ exports[`better eslint`] = {
|
||||
],
|
||||
"public/app/features/query/components/QueryGroup.tsx:5381": [
|
||||
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"],
|
||||
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "1"],
|
||||
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "2"]
|
||||
[0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "1"]
|
||||
],
|
||||
"public/app/features/query/state/DashboardQueryRunner/AlertStatesWorker.test.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||
|
@ -184,7 +184,7 @@ export const Components = {
|
||||
content: 'Query editor tab content',
|
||||
queryInspectorButton: 'Query inspector button',
|
||||
queryHistoryButton: 'data-testid query-history-button',
|
||||
addQuery: 'Query editor add query button',
|
||||
addQuery: 'data-testid query-tab-add-query',
|
||||
},
|
||||
QueryHistory: {
|
||||
queryText: 'Query text',
|
||||
|
@ -61,7 +61,7 @@ describe('QueryGroup', () => {
|
||||
it('Should add query on click', async () => {
|
||||
renderScenario({});
|
||||
|
||||
const addQueryButton = await screen.findByTestId('query-tab-add-query');
|
||||
const addQueryButton = await screen.findByRole('button', { name: /Add query/i });
|
||||
const queryRowsContainer = await screen.findByTestId('query-editor-rows');
|
||||
expect(queryRowsContainer.children.length).toBe(2);
|
||||
|
||||
@ -92,7 +92,7 @@ describe('QueryGroup', () => {
|
||||
it('New query should be expanded', async () => {
|
||||
renderScenario({});
|
||||
|
||||
const addQueryButton = await screen.findByTestId('query-tab-add-query');
|
||||
const addQueryButton = await screen.findByRole('button', { name: /Add query/i });
|
||||
const queryRowsContainer = await screen.findByTestId('query-editor-rows');
|
||||
await userEvent.click(addQueryButton);
|
||||
|
||||
@ -119,7 +119,7 @@ describe('QueryGroup', () => {
|
||||
it('Should not show add expression button when expressions are disabled', async () => {
|
||||
config.expressionsEnabled = false;
|
||||
renderScenario({});
|
||||
await screen.findByTestId('query-tab-add-query');
|
||||
await screen.findByRole('button', { name: /Add query/i });
|
||||
const addExpressionButton = screen.queryByTestId('query-tab-add-expression');
|
||||
expect(addExpressionButton).not.toBeInTheDocument();
|
||||
});
|
||||
|
@ -371,10 +371,9 @@ export class QueryGroup extends PureComponent<Props, State> {
|
||||
icon="plus"
|
||||
onClick={this.onAddQueryClick}
|
||||
variant="secondary"
|
||||
aria-label={selectors.components.QueryTab.addQuery}
|
||||
data-testid="query-tab-add-query"
|
||||
data-testid={selectors.components.QueryTab.addQuery}
|
||||
>
|
||||
Query
|
||||
Add query
|
||||
</Button>
|
||||
)}
|
||||
{config.expressionsEnabled && this.isExpressionsSupported(dsSettings) && (
|
||||
|
Loading…
Reference in New Issue
Block a user