blob: a201bcca64fd44659216810ce7d1117535192136 [file] [log] [blame]
Chris Craik24385db2015-06-11 11:16:26 -07001<!DOCTYPE html>
2<!--
3Copyright (c) 2015 The Chromium Authors. All rights reserved.
4Use of this source code is governed by a BSD-style license that can be
5found in the LICENSE file.
6-->
7<link rel="import" href="/base/units/array_of_numbers_span.html">
8<script>
9'use strict';
10
11tr.b.unittest.testSuite(function() {
12 test('instantiateInAverageMode', function() {
13 var span = document.createElement('tr-b-u-array-of-numbers-span');
14 span.numbers = [1, 2, 3];
15 span.summaryMode = tr.b.units.ArrayOfNumbersSummaryModes.AVERAGE_MODE;
16 this.addHTMLOutput(span);
17 assert.equal(span.shadowRoot.textContent, '2');
18 });
19
20 test('instantiateInTotalsMode', function() {
21 var span = document.createElement('tr-b-u-array-of-numbers-span');
22 span.numbers = [1, 2, 3];
23 span.summaryMode = tr.b.units.ArrayOfNumbersSummaryModes.TOTALS_MODE;
24 this.addHTMLOutput(span);
25 assert.equal(span.shadowRoot.textContent, '6');
26 });
27});
28</script>