mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
InfluxDB: InfluxQL query editor: generate better HTML (#34467)
This commit is contained in:
@@ -176,11 +176,9 @@ export const Seg = ({
|
|||||||
const [isOpen, setOpen] = useState(false);
|
const [isOpen, setOpen] = useState(false);
|
||||||
if (!isOpen) {
|
if (!isOpen) {
|
||||||
const className = cx(defaultButtonClass, buttonClassName);
|
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 (
|
return (
|
||||||
<InlineLabel
|
<InlineLabel
|
||||||
|
as="button"
|
||||||
className={className}
|
className={className}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setOpen(true);
|
setOpen(true);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ async function assertSegmentSelect(
|
|||||||
callbackValue: unknown
|
callbackValue: unknown
|
||||||
) {
|
) {
|
||||||
// we find the segment
|
// we find the segment
|
||||||
const segs = screen.getAllByText(segmentText, { selector: 'label' });
|
const segs = screen.getAllByRole('button', { name: segmentText });
|
||||||
expect(segs.length).toBe(1);
|
expect(segs.length).toBe(1);
|
||||||
const seg = segs[0];
|
const seg = segs[0];
|
||||||
expect(seg).toBeInTheDocument();
|
expect(seg).toBeInTheDocument();
|
||||||
|
|||||||
Reference in New Issue
Block a user