Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: dashboard/dashboard/elements/bug-details-test.html

Issue 2706813003: Add new endpoint to get bug details as JSON. (Closed)
Patch Set: addressed review comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dashboard/dashboard/elements/bug-details-test.html
diff --git a/dashboard/dashboard/elements/bug-details-test.html b/dashboard/dashboard/elements/bug-details-test.html
new file mode 100644
index 0000000000000000000000000000000000000000..cdc1212df5ac8517b91e998c33a4c37a056e85de
--- /dev/null
+++ b/dashboard/dashboard/elements/bug-details-test.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<!--
+Copyright 2017 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+-->
+
+<link rel="import" href="/dashboard/elements/bug-details.html">
+<link rel="import" href="/dashboard/static/testing_common.html">
+
+<link rel="import" href="/tracing/core/test_utils.html">
+
+<script>
+'use strict';
+
+
+tr.b.unittest.testSuite(function() {
+ var testOptions = {
+ setUp: function() {
+ },
+ tearDown: function() {
+ testing_common.clearXhrMock();
+ }
+ };
+
+ test('instantiation', function() {
+ var mockResponse = {
+ 'review_urls': [
+ 'http://codereview.google.com/12345',
+ 'http://review.chromium.org/23435'
+ ],
+ 'bisects': [
+ {
+ 'status': 'failed',
+ 'metric': 'Total',
+ 'buildbucket_link': '/foo/bar',
+ 'bot': 'android-nexus5-perf-bisect'
+ },
+ {
+ 'status': 'started',
+ 'metric': 'Total',
+ 'buildbucket_link': '/foo/bar',
+ 'bot': 'windows-perf-bisect'
+ },
+ ],
+ 'owner': 'foo@bar.com',
+ 'published': '2017-02-17T23:08:44',
+ 'state': 'open',
+ 'status': 'Untriaged',
+ 'summary': 'A regression in Sunspider occurred!'
+ };
+ testing_common.addXhrMock(
+ '/bug_details?bug_id=12345',
+ JSON.stringify(mockResponse));
+ var e = document.createElement('bug-details');
+ e.bugId = 12345;
+ this.addHTMLOutput(e);
+ }, testOptions);
+
+ test('error', function() {
+ var mockResponse = {
+ 'error': 'failed to load!'
+ };
+ testing_common.addXhrMock(
+ '/bug_details?bug_id=12345',
+ JSON.stringify(mockResponse));
+ var e = document.createElement('bug-details');
+ e.bugId = 12345;
+ this.addHTMLOutput(e);
+ }, testOptions);
+});
+</script>
« no previous file with comments | « dashboard/dashboard/elements/bug-details.html ('k') | dashboard/dashboard/services/issue_tracker_service.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698