mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 08:05:43 -06:00
* Add and configure eslint-plugin-import * Fix the lint:ts npm command * Autofix + prettier all the files * Manually fix remaining files * Move jquery code in jest-setup to external file to safely reorder imports * Resolve issue caused by circular dependencies within Prometheus * Update .betterer.results * Fix missing // @ts-ignore * ignore iconBundle.ts * Fix missing // @ts-ignore
49 lines
1013 B
TypeScript
49 lines
1013 B
TypeScript
import { DefaultTimeZone, toUtc } from '@grafana/data';
|
|
|
|
import { ExploreId } from '../../../types';
|
|
|
|
export const createDefaultInitialState = () => {
|
|
const t = toUtc();
|
|
const testRange = {
|
|
from: t,
|
|
to: t,
|
|
raw: {
|
|
from: t,
|
|
to: t,
|
|
},
|
|
};
|
|
|
|
const defaultInitialState = {
|
|
user: {
|
|
orgId: '1',
|
|
timeZone: DefaultTimeZone,
|
|
},
|
|
explore: {
|
|
[ExploreId.left]: {
|
|
datasourceInstance: {
|
|
query: jest.fn(),
|
|
getRef: jest.fn(),
|
|
getLogsVolumeDataProvider: jest.fn(),
|
|
meta: {
|
|
id: 'something',
|
|
},
|
|
},
|
|
initialized: true,
|
|
containerWidth: 1920,
|
|
eventBridge: { emit: () => {} } as any,
|
|
queries: [{ expr: 'test' }] as any[],
|
|
range: testRange,
|
|
history: [],
|
|
refreshInterval: {
|
|
label: 'Off',
|
|
value: 0,
|
|
},
|
|
cache: [],
|
|
richHistory: [],
|
|
},
|
|
},
|
|
};
|
|
|
|
return { testRange, defaultInitialState };
|
|
};
|