Commit 05dc1407 authored by Phil Hughes's avatar Phil Hughes

Updated specs

parent b55ab7ab
...@@ -51,9 +51,10 @@ describe('Metrics deployments', () => { ...@@ -51,9 +51,10 @@ describe('Metrics deployments', () => {
return d.promise(); return d.promise();
}); });
prometheusGraph.configureGraph();
prometheusGraph.transformData(prometheusMockData.metrics); prometheusGraph.transformData(prometheusMockData.metrics);
deployment.init(prometheusGraph.data.memory_values); deployment.init(prometheusGraph.graphSpecificProperties.memory_values.data);
}); });
it('creates line on graph for deploment', () => { it('creates line on graph for deploment', () => {
...@@ -76,37 +77,37 @@ describe('Metrics deployments', () => { ...@@ -76,37 +77,37 @@ describe('Metrics deployments', () => {
it('shows sha short code when tag is false', () => { it('shows sha short code when tag is false', () => {
expect( expect(
graphElement().querySelector('.deploy-info-1 .js-deploy-info-box').textContent.trim(), graphElement().querySelector('.deploy-info-1-cpu_values .js-deploy-info-box').textContent.trim(),
).toContain('testin'); ).toContain('testin');
}); });
it('shows ref name when tag is true', () => { it('shows ref name when tag is true', () => {
expect( expect(
graphElement().querySelector('.deploy-info-2 .js-deploy-info-box').textContent.trim(), graphElement().querySelector('.deploy-info-2-cpu_values .js-deploy-info-box').textContent.trim(),
).toContain('tag'); ).toContain('tag');
}); });
it('shows info box when moving mouse over line', () => { it('shows info box when moving mouse over line', () => {
deployment.mouseOverDeployInfo(deployment.data[0].xPos); deployment.mouseOverDeployInfo(deployment.data[0].xPos, 'cpu_values');
expect( expect(
graphElement().querySelectorAll('.prometheus-graph .js-deploy-info-box.hidden').length, graphElement().querySelectorAll('.prometheus-graph .js-deploy-info-box.hidden').length,
).toBe(1); ).toBe(1);
expect( expect(
graphElement().querySelector('.deploy-info-1 .js-deploy-info-box.hidden'), graphElement().querySelector('.deploy-info-1-cpu_values .js-deploy-info-box.hidden'),
).toBeNull(); ).toBeNull();
}); });
it('hides previously visible info box when moving mouse away', () => { it('hides previously visible info box when moving mouse away', () => {
deployment.mouseOverDeployInfo(500); deployment.mouseOverDeployInfo(500, 'cpu_values');
expect( expect(
graphElement().querySelectorAll('.prometheus-graph .js-deploy-info-box.hidden').length, graphElement().querySelectorAll('.prometheus-graph .js-deploy-info-box.hidden').length,
).toBe(2); ).toBe(2);
expect( expect(
graphElement().querySelector('.deploy-info-1 .js-deploy-info-box.hidden'), graphElement().querySelector('.deploy-info-1-cpu_values .js-deploy-info-box.hidden'),
).not.toBeNull(); ).not.toBeNull();
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment