spans.spec.tsx 809 B

12345678910111213141516171819202122232425
  1. import {OrganizationFixture} from 'sentry-fixture/organization';
  2. import type {Organization} from 'sentry/types/organization';
  3. import {ALLOWED_EXPLORE_VISUALIZE_AGGREGATES} from 'sentry/utils/fields';
  4. import {SpansConfig} from 'sentry/views/dashboards/datasetConfig/spans';
  5. describe('SpansConfig', () => {
  6. let organization: Organization;
  7. beforeEach(() => {
  8. organization = OrganizationFixture({
  9. features: ['performance-view'],
  10. });
  11. });
  12. it('returns all of the EAP aggregations as primary options', () => {
  13. const functionOptions = Object.keys(
  14. SpansConfig.getTableFieldOptions(organization, {})
  15. )
  16. .filter(func => func.startsWith('function'))
  17. .map(func => func.split(':')[1]);
  18. expect(functionOptions).toEqual(ALLOWED_EXPLORE_VISUALIZE_AGGREGATES);
  19. });
  20. });