mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 11:20:27 -06:00
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:
parent
651bb773db
commit
6a828a051a
@ -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', () => {
|
||||
|
@ -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>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user