|
@@ -1,4 +1,4 @@
|
|
|
-import type {MRI, PageFilters} from 'sentry/types';
|
|
|
+import type {PageFilters} from 'sentry/types/core';
|
|
|
import {
|
|
|
createMqlQuery,
|
|
|
getMetricsQueryApiRequestPayload,
|
|
@@ -45,7 +45,7 @@ describe('getMetricsQueryApiRequestPayload', () => {
|
|
|
const metric = {
|
|
|
query: 'error',
|
|
|
groupBy: ['project'],
|
|
|
- mri: 'c:custom/sessions@none' as MRI,
|
|
|
+ mri: 'c:custom/sessions@none' as const,
|
|
|
op: 'avg',
|
|
|
name: 'query_1',
|
|
|
};
|
|
@@ -79,7 +79,7 @@ describe('getMetricsQueryApiRequestPayload', () => {
|
|
|
|
|
|
it('should return the correct query object with default values (period)', () => {
|
|
|
const metric = {
|
|
|
- mri: 'c:custom/sessions@none' as MRI,
|
|
|
+ mri: 'c:custom/sessions@none' as const,
|
|
|
op: 'avg',
|
|
|
query: 'error',
|
|
|
groupBy: ['project'],
|
|
@@ -114,7 +114,7 @@ describe('getMetricsQueryApiRequestPayload', () => {
|
|
|
|
|
|
it('should return the correct query object with overridden values', () => {
|
|
|
const metric = {
|
|
|
- mri: 'c:custom/sessions@none' as MRI,
|
|
|
+ mri: 'c:custom/sessions@none' as const,
|
|
|
op: 'avg',
|
|
|
query: 'error',
|
|
|
groupBy: ['project'],
|
|
@@ -153,7 +153,7 @@ describe('getMetricsQueryApiRequestPayload', () => {
|
|
|
|
|
|
it('should not add a default orderBy if one is already present', () => {
|
|
|
const metric = {
|
|
|
- mri: 'c:custom/sessions@none' as MRI,
|
|
|
+ mri: 'c:custom/sessions@none' as const,
|
|
|
op: 'avg',
|
|
|
query: 'error',
|
|
|
groupBy: ['project'],
|
|
@@ -190,7 +190,7 @@ describe('getMetricsQueryApiRequestPayload', () => {
|
|
|
|
|
|
it('should not add a default orderBy if there are no groups', () => {
|
|
|
const metric = {
|
|
|
- mri: 'c:custom/sessions@none' as MRI,
|
|
|
+ mri: 'c:custom/sessions@none' as const,
|
|
|
op: 'avg',
|
|
|
query: 'error',
|
|
|
groupBy: [],
|
|
@@ -226,7 +226,7 @@ describe('getMetricsQueryApiRequestPayload', () => {
|
|
|
|
|
|
it('should not add intervalLadder override into the request', () => {
|
|
|
const metric = {
|
|
|
- mri: 'c:custom/test@seconds' as MRI,
|
|
|
+ mri: 'c:custom/test@seconds' as const,
|
|
|
op: 'sum',
|
|
|
query: 'error',
|
|
|
groupBy: [],
|