mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Graph: introduce Tooltip to React graph (#20046)
This commit is contained in:
@@ -58,7 +58,7 @@ const testContext = (options: any = {}) => {
|
||||
queryIntervals: { intervalMs: 10 },
|
||||
} as any) as ExploreItemState;
|
||||
|
||||
const resultProcessor = new ResultProcessor(state, combinedOptions.dataFrames, 60000);
|
||||
const resultProcessor = new ResultProcessor(state, combinedOptions.dataFrames, 60000, 'utc');
|
||||
|
||||
return {
|
||||
dataFrames: combinedOptions.dataFrames,
|
||||
@@ -99,7 +99,9 @@ describe('ResultProcessor', () => {
|
||||
describe('constructed with a result that is a DataQueryResponse', () => {
|
||||
describe('when calling getGraphResult', () => {
|
||||
it('then it should return correct graph result', () => {
|
||||
const { resultProcessor } = testContext();
|
||||
const { resultProcessor, dataFrames } = testContext();
|
||||
const timeField = dataFrames[0].fields[1];
|
||||
const valueField = dataFrames[0].fields[0];
|
||||
const theResult = resultProcessor.getGraphResult();
|
||||
|
||||
expect(theResult).toEqual([
|
||||
@@ -112,6 +114,10 @@ describe('ResultProcessor', () => {
|
||||
yAxis: {
|
||||
index: 1,
|
||||
},
|
||||
seriesIndex: 0,
|
||||
timeField,
|
||||
valueField,
|
||||
timeStep: 100,
|
||||
},
|
||||
]);
|
||||
});
|
||||
@@ -138,6 +144,8 @@ describe('ResultProcessor', () => {
|
||||
describe('when calling getLogsResult', () => {
|
||||
it('then it should return correct logs result', () => {
|
||||
const { resultProcessor, dataFrames } = testContext({ mode: ExploreMode.Logs });
|
||||
const timeField = dataFrames[0].fields[1];
|
||||
const valueField = dataFrames[0].fields[0];
|
||||
const logsDataFrame = dataFrames[1];
|
||||
const theResult = resultProcessor.getLogsResult();
|
||||
|
||||
@@ -210,6 +218,10 @@ describe('ResultProcessor', () => {
|
||||
yAxis: {
|
||||
index: 1,
|
||||
},
|
||||
seriesIndex: 0,
|
||||
timeField,
|
||||
valueField,
|
||||
timeStep: 100,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user