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

Unified Diff: dashboard/dashboard/static/series_group_test.html

Issue 2756573004: [Dashboard] Formalize SeriesGroup (Closed)
Patch Set: JSON.parse oops Created 3 years, 9 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
« no previous file with comments | « dashboard/dashboard/static/series_group.html ('k') | dashboard/dashboard/static/simple_xhr.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/static/series_group_test.html
diff --git a/dashboard/dashboard/static/series_group_test.html b/dashboard/dashboard/static/series_group_test.html
new file mode 100644
index 0000000000000000000000000000000000000000..eb28d5b39625927ac8417017d2e0315bce0fa293
--- /dev/null
+++ b/dashboard/dashboard/static/series_group_test.html
@@ -0,0 +1,65 @@
+<!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/static/series_group.html">
+
+<script>
+'use strict';
+
+tr.b.unittest.testSuite(() => {
+ test('requestParamsBasic', () => {
+ const element = ['foo', []];
+ const params = d.listTestsRequestParams(element, true);
+ const testPathDict = JSON.parse(params.test_path_dict);
+ const testPathDictKeys = Object.keys(testPathDict);
+ assert.lengthOf(Object.keys(params), 3);
+ assert.strictEqual(params.type, 'test_path_dict');
+ assert.lengthOf(testPathDictKeys, 1);
+ assert.strictEqual(testPathDictKeys[0], 'foo');
+ });
+
+ test('requestParamsSelected', () => {
+ const element = ['foo', []];
+ const params = d.listTestsRequestParams(element, true);
+ assert.strictEqual(params.selected, '1');
+ });
+
+ test('requestParamsUnselected', () => {
+ const element = ['foo', []];
+ const params = d.listTestsRequestParams(element, false);
+ assert.strictEqual(params.selected, '0');
+ });
+
+ test('requestParamsAll', () => {
+ const element = ['foo', ['all']];
+ const params = d.listTestsRequestParams(element, true);
+ const testPathDict = JSON.parse(params.test_path_dict);
+ assert.equal(testPathDict.foo, 'all');
+ });
+
+ test('requestParamsImportant', () => {
+ const element = ['foo', ['important']];
+ const params = d.listTestsRequestParams(element, true);
+ const testPathDict = JSON.parse(params.test_path_dict);
+ assert.strictEqual(testPathDict.foo, 'core');
+ });
+
+ test('requestParamsNone', () => {
+ const element = ['foo', ['none']];
+ const params = d.listTestsRequestParams(element, true);
+ const testPathDict = JSON.parse(params.test_path_dict);
+ assert.deepEqual(testPathDict.foo, []);
+ });
+
+ test('requestParamsExact', () => {
+ const element = ['foo', ['abc', 'xyz']];
+ const params = d.listTestsRequestParams(element, true);
+ const testPathDict = JSON.parse(params.test_path_dict);
+ assert.deepEqual(testPathDict.foo, ['abc', 'xyz']);
+ });
+});
+</script>
« no previous file with comments | « dashboard/dashboard/static/series_group.html ('k') | dashboard/dashboard/static/simple_xhr.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698