dashboard.ts 654 B

123456789101112131415161718192021222324252627282930313233
  1. import type {
  2. DashboardDetails,
  3. DashboardFilters,
  4. DashboardListItem,
  5. Widget,
  6. } from 'sentry/views/dashboards/types';
  7. export function DashboardFixture(
  8. widgets: Widget[],
  9. props: Partial<DashboardDetails> = {}
  10. ): DashboardDetails {
  11. return {
  12. id: '1',
  13. filters: [] as DashboardFilters,
  14. dateCreated: new Date().toISOString(),
  15. projects: undefined,
  16. title: 'Dashboard',
  17. widgets,
  18. ...props,
  19. };
  20. }
  21. export function DashboardListItemFixture(
  22. params: Partial<DashboardListItem> = {}
  23. ): DashboardListItem {
  24. return {
  25. id: '1',
  26. title: 'Dashboard',
  27. widgetDisplay: [],
  28. widgetPreview: [],
  29. ...params,
  30. };
  31. }