blob: 7ffde8486e799322403b860ffe8c13d2f2f564e9 [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright (c) 2015 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="/ui/units/array_of_numbers_span.html">
<script>
'use strict';
tr.b.unittest.testSuite(function() {
test('instantiateInAverageMode', function() {
var span = document.createElement('tr-ui-u-array-of-numbers-span');
span.numbers = [1, 2, 3];
span.summaryMode = tr.ui.units.ArrayOfNumbersSummaryModes.AVERAGE_MODE;
this.addHTMLOutput(span);
assert.equal(span.shadowRoot.textContent, '2');
});
test('instantiateInTotalsMode', function() {
var span = document.createElement('tr-ui-u-array-of-numbers-span');
span.numbers = [1, 2, 3];
span.summaryMode = tr.ui.units.ArrayOfNumbersSummaryModes.TOTALS_MODE;
this.addHTMLOutput(span);
assert.equal(span.shadowRoot.textContent, '6');
});
});
</script>