Logs: Fix LogDetailsRow tests that produced console errors (#45388)

* Fix LogDetailsRow tests that produced console errors

* Use div instead of wrapping with table

* Use div instead of wrapping with table
This commit is contained in:
Ivana Huckova 2022-02-15 14:06:24 +01:00 committed by GitHub
parent 651bb773db
commit 6a828a051a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -20,7 +20,13 @@ const setup = (propOverrides?: Partial<Props>) => {
Object.assign(props, propOverrides);
return render(<LogDetailsRow {...props} />);
return render(
<table>
<tbody>
<LogDetailsRow {...props} />
</tbody>
</table>
);
};
describe('LogDetailsRow', () => {

View File

@ -15,10 +15,11 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => {
return {
logsStats: css`
label: logs-stats;
column-span: 2;
background: inherit;
color: ${theme.colors.text};
word-break: break-all;
width: fit-content;
max-width: 100%;
`,
logsStatsHeader: css`
label: logs-stats__header;
@ -74,7 +75,7 @@ class UnThemedLogLabelStats extends PureComponent<Props> {
const otherProportion = otherCount / total;
return (
<td className={style.logsStats} data-testid="logLabelStats">
<div className={style.logsStats} data-testid="logLabelStats">
<div className={style.logsStatsHeader}>
<div className={style.logsStatsTitle}>
{label}: {total} of {rowCount} rows have that {isLabel ? 'label' : 'field'}
@ -89,7 +90,7 @@ class UnThemedLogLabelStats extends PureComponent<Props> {
<LogLabelStatsRow key="__OTHERS__" count={otherCount} value="Other" proportion={otherProportion} />
)}
</div>
</td>
</div>
);
}
}