import { render } from '../../helpers/testUtils';
import { FCProps } from '../../types/misc';
import { FavoriteButton } from '../FavoriteButton';
+import { Tooltip } from '../Tooltip';
it('should render favorite filled', () => {
const { container } = renderFavoriteButton({ favorite: true });
function renderFavoriteButton(props: Partial<FCProps<typeof FavoriteButton>> = {}) {
return render(
- <FavoriteButton favorite overlay="label-info" toggleFavorite={jest.fn()} {...props} />,
+ <FavoriteButton
+ favorite
+ overlay="label-info"
+ toggleFavorite={jest.fn()}
+ tooltip={Tooltip}
+ {...props}
+ />,
);
}
});
function setupWithProps(props: Partial<FCProps<typeof LineCoverage>> = {}) {
- return render(<LineCoverage coverageStatus="covered" lineNumber={16} status="OK" {...props} />);
+ return render(<LineCoverage coverageStatus="covered" lineNumber={16} status="OK" {...props} />, {
+ container: document.createElement('tr'),
+ });
}
function setupWithProps(props: Partial<FCProps<typeof LineNumber>> = {}) {
return render(
- <LineNumber
- ariaLabel="aria-label"
- displayOptions
- firstLineNumber={1}
- lineNumber={16}
- popup={<div>Popup</div>}
- {...props}
- />,
+ <table>
+ <tbody>
+ <tr>
+ <LineNumber
+ ariaLabel="aria-label"
+ displayOptions
+ firstLineNumber={1}
+ lineNumber={16}
+ popup={<div>Popup</div>}
+ {...props}
+ />
+ </tr>
+ </tbody>
+ </table>,
);
}
function setupWithProps(props: Partial<FCProps<typeof LineWrapper>> = {}) {
return render(
<LineWrapper displayCoverage displaySCM duplicationsCount={2} highlighted={false} {...props} />,
+ { container: document.createElement('tbody') },
);
}
import { FCProps } from '../../types/misc';
import { MultiSelector } from '../MultiSelector';
import { Tags } from '../Tags';
+import { Tooltip } from '../Tooltip';
it('should display "no tags"', () => {
renderTags({ tags: [] });
emptyText="no tags"
overlay={overlay}
tags={selectedTags}
+ tooltip={Tooltip}
{...overrides}
/>
);
<div>
<button
+ aria-describedby="tooltip-2"
aria-label="label-info"
class="it__favorite-link it__is-filled emotion-0 emotion-1 emotion-2"
type="button"
<div>
<button
+ aria-describedby="tooltip-1"
aria-label="label-info"
class="it__favorite-link it__is-filled emotion-0 emotion-1 emotion-2"
type="button"
outline: none;
}
-<div>
+<tr>
<td
aria-describedby="tooltip-1"
class="emotion-0 emotion-1"
class="emotion-2 emotion-3"
/>
</td>
-</div>
+</tr>
`;
exports[`should render correctly when no data 1`] = `
background-color: rgb(239,242,249);
}
-<div>
+<tr>
<td
class="emotion-0 emotion-1"
data-line-number="16"
/>
-</div>
+</tr>
`;
exports[`should render correctly when partially covered with 5/10 conditions 1`] = `
outline: none;
}
-<div>
+<tr>
<td
aria-describedby="tooltip-4"
class="emotion-0 emotion-1"
</svg>
</div>
</td>
-</div>
+</tr>
`;
exports[`should render correctly when partially covered without conditions 1`] = `
outline: none;
}
-<div>
+<tr>
<td
aria-describedby="tooltip-3"
class="emotion-0 emotion-1"
</svg>
</div>
</td>
-</div>
+</tr>
`;
exports[`should render correctly when uncovered 1`] = `
outline: none;
}
-<div>
+<tr>
<td
aria-describedby="tooltip-2"
class="emotion-0 emotion-1"
class="emotion-2 emotion-3"
/>
</td>
-</div>
+</tr>
`;
font-weight: 400;
}
-<div>
+<tbody>
<tr
class="emotion-0 emotion-1"
style="--columns: 44px 50px 26px repeat(3, 6px) 1fr; --line-background: rgb(255,255,255);"
/>
-</div>
+</tbody>
`;