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:
@@ -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) && (
|
||||
|
||||
Reference in New Issue
Block a user