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

Unified Diff: dashboard/dashboard/elements/create-health-report-page-test.html

Issue 2622303003: Allows a user to create_health_reports. (Closed)
Patch Set: updated a test Created 3 years, 11 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/create-health-report-page-test.html
diff --git a/dashboard/dashboard/elements/create-health-report-page-test.html b/dashboard/dashboard/elements/create-health-report-page-test.html
new file mode 100644
index 0000000000000000000000000000000000000000..33ec66af0b2208e77bdf0c457324fd4e99a37e93
--- /dev/null
+++ b/dashboard/dashboard/elements/create-health-report-page-test.html
@@ -0,0 +1,66 @@
+<!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/create-health-report-page.html">
+<link rel="import" href="/dashboard/static/testing_common.html">
+
+<link rel="import" href="/tracing/base/unit.html">
+<link rel="import" href="/tracing/core/test_utils.html">
+
+<script>
+'use strict';
+
+tr.b.unittest.testSuite(function() {
+
+ var testOptions = {
+ tearDown: function() {
+ testing_common.clearXhrMock();
+ }
+ };
+
+ test('onSubmit sends request with parameters', function() {
+ var tokenParams = {
+ getToken: true
+ };
+ var mockTokenResponse = {
+ 'xsrf_token': 'fakeToken'
+ };
+ var query = '/create_health_report?' +
+ testing_common.paramString(tokenParams);
+ testing_common.addXhrMock(query, JSON.stringify(mockTokenResponse));
+
+ var tableParams = {
+ tableBots: 'testBot',
+ tableLayout: 'testLayout',
+ tableName: 'testName',
+ tableTests: 'testTest',
+ xsrf_token: 'fakeToken'
+ };
+ var mockTableResponse = {
+ 'xsrf_token': 'fakeToken',
+ 'name': 'testName'
+ };
+ var tableQuery = '/create_health_report?' +
+ testing_common.paramString(tableParams);
+ testing_common.addXhrMock(tableQuery, JSON.stringify(mockTableResponse));
+
+ var page = document.createElement('create-health-report-page');
+ page.name = 'testName';
+ page.bots = 'testBot';
+ page.tests = 'testTest';
+ page.layout = 'testLayout';
+ this.addHTMLOutput(page);
+ page.checkToken();
+ }, testOptions);
+
+ test('instantiation', function() {
+ var page = document.createElement('create-health-report-page');
+ this.addHTMLOutput(page);
+ }, testOptions);
+
+});
+</script>
« no previous file with comments | « dashboard/dashboard/elements/create-health-report-page.html ('k') | dashboard/dashboard/models/table_config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698