From 95ad09443817fb77598c9fca5b5c9e581055264d Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Thu, 17 Oct 2024 14:38:11 +0100 Subject: [PATCH] Sparkline: Add test to make sure the Sparkline at least renders (#94880) add test to make sure the sparkline at least renders --- .../components/Sparkline/Sparkline.test.tsx | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 packages/grafana-ui/src/components/Sparkline/Sparkline.test.tsx diff --git a/packages/grafana-ui/src/components/Sparkline/Sparkline.test.tsx b/packages/grafana-ui/src/components/Sparkline/Sparkline.test.tsx new file mode 100644 index 00000000000..9ad678132e9 --- /dev/null +++ b/packages/grafana-ui/src/components/Sparkline/Sparkline.test.tsx @@ -0,0 +1,30 @@ +import { render } from '@testing-library/react'; + +import { createTheme, FieldSparkline, FieldType } from '@grafana/data'; + +import { Sparkline } from './Sparkline'; + +describe('Sparkline', () => { + it('should render without throwing an error', () => { + const sparkline: FieldSparkline = { + x: { + name: 'x', + values: [1679839200000, 1680444000000, 1681048800000, 1681653600000, 1682258400000], + type: FieldType.time, + config: {}, + }, + y: { + name: 'y', + values: [1, 2, 3, 4, 5], + type: FieldType.number, + config: {}, + state: { + range: { min: 1, max: 5, delta: 1 }, + }, + }, + }; + expect(() => + render() + ).not.toThrow(); + }); +});