Index: dashboard/dashboard/elements/chart-container-test.html |
diff --git a/dashboard/dashboard/elements/chart-container-test.html b/dashboard/dashboard/elements/chart-container-test.html |
index 8c4c8387ec590a0dc3fea28bebb06fee34642bf3..bfc68bb416b3f6a141a871a0ccfd229d48e7368d 100644 |
--- a/dashboard/dashboard/elements/chart-container-test.html |
+++ b/dashboard/dashboard/elements/chart-container-test.html |
@@ -105,6 +105,33 @@ tr.b.unittest.testSuite(function() { |
'http___dromaeo.com?dom-attr'); |
}, testOptions); |
+ let originalUriGetQueryString; |
+ const testOptionsUri = { |
+ setUp() { |
+ originalUriGetQueryString = uri.getQueryString; |
+ }, |
+ tearDown() { |
+ testing_common.clearXhrMock(); |
+ testing_common.clearFixture(); |
+ uri.getQueryString = originalUriGetQueryString; |
+ } |
+ }; |
+ |
+ test('showTooltip uses uri bug_id', function() { |
+ uri.getQueryString = function() { return '?bug_id=123'; }; |
+ |
+ testing_common.mockChartJson( |
+ dromaeoCharts, dromaeoCharts.graphSelectedJson); |
+ testing_common.mockChartJson( |
+ sunspiderCharts, sunspiderCharts.graphSelectedJson); |
+ const chart = createChart(); |
+ this.addHTMLOutput(chart); |
+ chart.addSeriesGroup(dromaeoCharts.graphParams); |
+ chart.addSeriesGroup(sunspiderCharts.graphParams); |
+ chart.showTooltip(0, 0); |
+ assert.strictEqual(chart.$.tooltip.bugId, '123'); |
+ }, testOptionsUri); |
+ |
test('populateTestPicker', function() { |
testing_common.mockChartJson(dromaeoCharts); |
const chart = createChart(); |