diff --git a/src/components/fields/Checkbox.tsx b/src/components/fields/Checkbox.tsx index e420d5ed6..554699fde 100644 --- a/src/components/fields/Checkbox.tsx +++ b/src/components/fields/Checkbox.tsx @@ -35,7 +35,9 @@ export const Checkbox: FC = (props: ICheckbox) => { } > {props.label} - {props.tooltip && } + {props.tooltip && ( + + )} diff --git a/src/components/fields/Tooltip.test.tsx b/src/components/fields/Tooltip.test.tsx index 863847eec..e0eaa9607 100644 --- a/src/components/fields/Tooltip.test.tsx +++ b/src/components/fields/Tooltip.test.tsx @@ -6,6 +6,7 @@ import { type ITooltip, Tooltip } from './Tooltip'; describe('components/fields/Tooltip.tsx', () => { const props: ITooltip = { + name: 'tooltip', tooltip: 'This is some tooltip text', }; @@ -17,7 +18,7 @@ describe('components/fields/Tooltip.tsx', () => { it('should display on mouse enter / leave', () => { render(); - const tooltipElement = screen.getByTitle('tooltip'); + const tooltipElement = screen.getByLabelText('tooltip'); fireEvent.mouseEnter(tooltipElement); expect(tooltipElement).toMatchSnapshot(); diff --git a/src/components/fields/Tooltip.tsx b/src/components/fields/Tooltip.tsx index 3a9232fa9..fdf892238 100644 --- a/src/components/fields/Tooltip.tsx +++ b/src/components/fields/Tooltip.tsx @@ -2,6 +2,7 @@ import { QuestionIcon } from '@primer/octicons-react'; import { type FC, type ReactNode, useState } from 'react'; export interface ITooltip { + name: string; tooltip: ReactNode | string; } @@ -10,7 +11,8 @@ export const Tooltip: FC = (props: ITooltip) => { return ( setShowTooltip(true)} onMouseLeave={() => setShowTooltip(false)} diff --git a/src/components/fields/__snapshots__/Tooltip.test.tsx.snap b/src/components/fields/__snapshots__/Tooltip.test.tsx.snap index c2ed6592f..e4586a879 100644 --- a/src/components/fields/__snapshots__/Tooltip.test.tsx.snap +++ b/src/components/fields/__snapshots__/Tooltip.test.tsx.snap @@ -2,8 +2,9 @@ exports[`components/fields/Tooltip.tsx should display on mouse enter / leave 1`] = `
+
+ See{' '} + {' '} + for more details. +
+
+ } /> Show notifications from Bot accounts + + @@ -402,8 +426,9 @@ exports[`routes/Settings.tsx should render itself & its children 1`] = ` > Show notifications from Bot accounts