Graph: introduce Tooltip to React graph (#20046)

This commit is contained in:
Dominik Prokop
2019-11-07 12:37:46 +01:00
committed by GitHub
parent 08ada20270
commit 96dbed5efc
47 changed files with 1697 additions and 3437 deletions

View File

@@ -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,
},
],
});