mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -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);
|
Object.assign(props, propOverrides);
|
||||||
|
|
||||||
return render(<LogDetailsRow {...props} />);
|
return render(
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<LogDetailsRow {...props} />
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('LogDetailsRow', () => {
|
describe('LogDetailsRow', () => {
|
||||||
|
@ -15,10 +15,11 @@ const getStyles = stylesFactory((theme: GrafanaTheme) => {
|
|||||||
return {
|
return {
|
||||||
logsStats: css`
|
logsStats: css`
|
||||||
label: logs-stats;
|
label: logs-stats;
|
||||||
column-span: 2;
|
|
||||||
background: inherit;
|
background: inherit;
|
||||||
color: ${theme.colors.text};
|
color: ${theme.colors.text};
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
|
width: fit-content;
|
||||||
|
max-width: 100%;
|
||||||
`,
|
`,
|
||||||
logsStatsHeader: css`
|
logsStatsHeader: css`
|
||||||
label: logs-stats__header;
|
label: logs-stats__header;
|
||||||
@ -74,7 +75,7 @@ class UnThemedLogLabelStats extends PureComponent<Props> {
|
|||||||
const otherProportion = otherCount / total;
|
const otherProportion = otherCount / total;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<td className={style.logsStats} data-testid="logLabelStats">
|
<div className={style.logsStats} data-testid="logLabelStats">
|
||||||
<div className={style.logsStatsHeader}>
|
<div className={style.logsStatsHeader}>
|
||||||
<div className={style.logsStatsTitle}>
|
<div className={style.logsStatsTitle}>
|
||||||
{label}: {total} of {rowCount} rows have that {isLabel ? 'label' : 'field'}
|
{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} />
|
<LogLabelStatsRow key="__OTHERS__" count={otherCount} value="Other" proportion={otherProportion} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user