Skip to content

Commit

Permalink
Fix jest test
Browse files Browse the repository at this point in the history
  • Loading branch information
sulemanof committed Apr 24, 2020
1 parent 30aa798 commit 20c8092
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,29 +86,18 @@ describe('stdDeviationBands(resp, panel, series)', () => {
test('creates a series', () => {
const next = results => results;
const results = stdDeviationBands(resp, panel, series)(next)([]);
expect(results).toHaveLength(2);
expect(results).toHaveLength(1);

expect(results[0]).toEqual({
id: 'test:upper',
id: 'test',
label: 'Std. Deviation of cpu',
color: 'rgb(255, 0, 0)',
lines: { show: true, fill: 0.5, lineWidth: 0 },
points: { show: false },
fillBetween: 'test:lower',
data: [
[1, 3.2],
[2, 3.5],
],
});

expect(results[1]).toEqual({
id: 'test:lower',
color: 'rgb(255, 0, 0)',
lines: { show: true, fill: false, lineWidth: 0 },
lines: { show: true, fill: 0.5, lineWidth: 0, mode: 'band' },
bars: { show: false, fill: 0.5, mode: 'band' },
points: { show: false },
data: [
[1, 0.2],
[2, 0.5],
[1, 3.2, 0.2],
[2, 3.5, 0.5],
],
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,29 +86,18 @@ describe('stdDeviationSibling(resp, panel, series)', () => {
test('creates a series', () => {
const next = results => results;
const results = stdDeviationSibling(resp, panel, series)(next)([]);
expect(results).toHaveLength(2);
expect(results).toHaveLength(1);

expect(results[0]).toEqual({
id: 'test:lower',
id: 'test',
color: 'rgb(255, 0, 0)',
lines: { show: true, fill: false, lineWidth: 0 },
points: { show: false },
data: [
[1, 0.01],
[2, 0.01],
],
});

expect(results[1]).toEqual({
id: 'test:upper',
label: 'Overall Std. Deviation of Average of cpu',
color: 'rgb(255, 0, 0)',
fillBetween: 'test:lower',
lines: { show: true, fill: 0.5, lineWidth: 0 },
lines: { show: true, fill: 0.5, lineWidth: 0, mode: 'band' },
bars: { show: false, fill: 0.5, mode: 'band' },
points: { show: false },
data: [
[1, 0.7],
[2, 0.7],
[1, 0.7, 0.01],
[2, 0.7, 0.01],
],
});
});
Expand Down

0 comments on commit 20c8092

Please sign in to comment.