Merge "Display message when no changes are available"

This commit is contained in:
Edwin Kempin
2016-02-29 17:47:59 +00:00
committed by Gerrit Code Review
3 changed files with 27 additions and 0 deletions

View File

@@ -49,6 +49,9 @@ limitations under the License.
<template is="dom-if" if="[[_groupTitle(groupIndex)]]">
<div class="groupHeader">[[_groupTitle(groupIndex)]]</div>
</template>
<template is="dom-if" if="[[!changeGroup.length]]">
<div class="noChanges">No changes</div>
</template>
<template is="dom-repeat" items="[[changeGroup]]" as="change">
<gr-change-list-item
selected$="[[_computeItemSelected(index, groupIndex, selectedIndex)]]"

View File

@@ -29,6 +29,10 @@ limitations under the License.
background-color: #ddd;
flex-shrink: 0;
}
.noChanges {
border-bottom: 1px solid #eee;
padding: .3em .5em;
}
.keyboard,
.star {
align-items: center;

View File

@@ -136,6 +136,26 @@ limitations under the License.
assert.isFalse(elementItems[2].hasAttribute('unreviewed'));
});
test('no changes', function() {
element.changes = [];
flushAsynchronousOperations();
var listItems = Polymer.dom(element.root).querySelectorAll(
'gr-change-list-item');
assert.equal(listItems.length, 0);
var noChangesMsg = Polymer.dom(element.root).querySelector('.noChanges');
assert.ok(noChangesMsg);
});
test('empty groups', function() {
element.groups = [[], []];
flushAsynchronousOperations();
var listItems = Polymer.dom(element.root).querySelectorAll(
'gr-change-list-item');
assert.equal(listItems.length, 0);
var noChangesMsg = Polymer.dom(element.root).querySelectorAll(
'.noChanges');
assert.equal(noChangesMsg.length, 2);
});
});
suite('gr-change-list groups', function() {