Skip to content

Commit 20c8092

Browse files
committed
Fix jest test
1 parent 30aa798 commit 20c8092

2 files changed

Lines changed: 12 additions & 34 deletions

File tree

src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_bands.test.js

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,29 +86,18 @@ describe('stdDeviationBands(resp, panel, series)', () => {
8686
test('creates a series', () => {
8787
const next = results => results;
8888
const results = stdDeviationBands(resp, panel, series)(next)([]);
89-
expect(results).toHaveLength(2);
89+
expect(results).toHaveLength(1);
9090

9191
expect(results[0]).toEqual({
92-
id: 'test:upper',
92+
id: 'test',
9393
label: 'Std. Deviation of cpu',
9494
color: 'rgb(255, 0, 0)',
95-
lines: { show: true, fill: 0.5, lineWidth: 0 },
96-
points: { show: false },
97-
fillBetween: 'test:lower',
98-
data: [
99-
[1, 3.2],
100-
[2, 3.5],
101-
],
102-
});
103-
104-
expect(results[1]).toEqual({
105-
id: 'test:lower',
106-
color: 'rgb(255, 0, 0)',
107-
lines: { show: true, fill: false, lineWidth: 0 },
95+
lines: { show: true, fill: 0.5, lineWidth: 0, mode: 'band' },
96+
bars: { show: false, fill: 0.5, mode: 'band' },
10897
points: { show: false },
10998
data: [
110-
[1, 0.2],
111-
[2, 0.5],
99+
[1, 3.2, 0.2],
100+
[2, 3.5, 0.5],
112101
],
113102
});
114103
});

src/plugins/vis_type_timeseries/server/lib/vis_data/response_processors/series/std_deviation_sibling.test.js

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,29 +86,18 @@ describe('stdDeviationSibling(resp, panel, series)', () => {
8686
test('creates a series', () => {
8787
const next = results => results;
8888
const results = stdDeviationSibling(resp, panel, series)(next)([]);
89-
expect(results).toHaveLength(2);
89+
expect(results).toHaveLength(1);
9090

9191
expect(results[0]).toEqual({
92-
id: 'test:lower',
92+
id: 'test',
9393
color: 'rgb(255, 0, 0)',
94-
lines: { show: true, fill: false, lineWidth: 0 },
95-
points: { show: false },
96-
data: [
97-
[1, 0.01],
98-
[2, 0.01],
99-
],
100-
});
101-
102-
expect(results[1]).toEqual({
103-
id: 'test:upper',
10494
label: 'Overall Std. Deviation of Average of cpu',
105-
color: 'rgb(255, 0, 0)',
106-
fillBetween: 'test:lower',
107-
lines: { show: true, fill: 0.5, lineWidth: 0 },
95+
lines: { show: true, fill: 0.5, lineWidth: 0, mode: 'band' },
96+
bars: { show: false, fill: 0.5, mode: 'band' },
10897
points: { show: false },
10998
data: [
110-
[1, 0.7],
111-
[2, 0.7],
99+
[1, 0.7, 0.01],
100+
[2, 0.7, 0.01],
112101
],
113102
});
114103
});

0 commit comments

Comments
 (0)