minibarChart.spec.tsx 848 B

12345678910111213141516171819202122232425
  1. import {getGroupReleaseChartMarkers} from 'sentry/components/group/releaseChart';
  2. import type {TimeseriesValue} from 'sentry/types';
  3. import theme from 'sentry/utils/theme';
  4. it('should set marker before first bucket', () => {
  5. const data: TimeseriesValue[] = [
  6. [1659524400, 0],
  7. [1659528000, 0],
  8. [1659531600, 0],
  9. [1659535200, 2],
  10. [1659538800, 10],
  11. [1659542400, 6],
  12. [1659546000, 8],
  13. [1659549600, 0],
  14. [1659553200, 0],
  15. ];
  16. const firstSeen = '2022-08-03T14:48:04Z';
  17. const lastSeen = '2022-08-03T20:23:05Z';
  18. const markers = getGroupReleaseChartMarkers(theme as any, data, firstSeen, lastSeen)!
  19. .data!;
  20. expect((markers[0] as any).displayValue).toBe(new Date(firstSeen).getTime());
  21. expect(markers[0].coord![0]).toBe(1659533400000);
  22. expect(markers[1].coord![0]).toBe(new Date(lastSeen).getTime());
  23. });