From d95cc4a08f70720719d816afd23012f953c44593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Farkas?= Date: Thu, 20 May 2021 16:46:08 +0200 Subject: [PATCH] InfluxDB: InfluxQL query editor: generate better HTML (#34467) --- .../influxdb/components/VisualInfluxQLEditor/Seg.tsx | 4 +--- .../components/VisualInfluxQLEditor/TagsSection.test.tsx | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/public/app/plugins/datasource/influxdb/components/VisualInfluxQLEditor/Seg.tsx b/public/app/plugins/datasource/influxdb/components/VisualInfluxQLEditor/Seg.tsx index aa2d2e3b6b3..cc94d6c288a 100644 --- a/public/app/plugins/datasource/influxdb/components/VisualInfluxQLEditor/Seg.tsx +++ b/public/app/plugins/datasource/influxdb/components/VisualInfluxQLEditor/Seg.tsx @@ -176,11 +176,9 @@ export const Seg = ({ const [isOpen, setOpen] = useState(false); if (!isOpen) { const className = cx(defaultButtonClass, buttonClassName); - // this should not be a label, this should be a button, - // but this is what is used inside a Segment, and i just - // want the same look return ( { setOpen(true); diff --git a/public/app/plugins/datasource/influxdb/components/VisualInfluxQLEditor/TagsSection.test.tsx b/public/app/plugins/datasource/influxdb/components/VisualInfluxQLEditor/TagsSection.test.tsx index 15ea1908771..c276373684a 100644 --- a/public/app/plugins/datasource/influxdb/components/VisualInfluxQLEditor/TagsSection.test.tsx +++ b/public/app/plugins/datasource/influxdb/components/VisualInfluxQLEditor/TagsSection.test.tsx @@ -31,7 +31,7 @@ async function assertSegmentSelect( callbackValue: unknown ) { // we find the segment - const segs = screen.getAllByText(segmentText, { selector: 'label' }); + const segs = screen.getAllByRole('button', { name: segmentText }); expect(segs.length).toBe(1); const seg = segs[0]; expect(seg).toBeInTheDocument();