Exclude WIP changes from changes needing review
Since change I16b303e6e, WIP changes appear in 'Assigned reviews'
dashboard categories and may appear as needing review.
WIP changes should not appear as needing review.
Bug: Issue 10155
Change-Id: I93f613ede8a4dd5f38b09c1cb6d7a931c165e629
(cherry picked from commit 3d7531d22f)
This commit is contained in:
committed by
Réda Housni Alaoui
parent
9c40e8faf5
commit
056ccd0717
@@ -226,6 +226,7 @@
|
||||
|
||||
_computeItemNeedsReview(account, change, showReviewedState) {
|
||||
return showReviewedState && !change.reviewed &&
|
||||
!change.work_in_progress &&
|
||||
this.changeIsOpen(change.status) &&
|
||||
(!account || account._account_id != change.owner._account_id);
|
||||
},
|
||||
|
||||
@@ -231,11 +231,17 @@ limitations under the License.
|
||||
status: 'ABANDONED',
|
||||
owner: {_account_id: 0},
|
||||
},
|
||||
{
|
||||
_number: 4,
|
||||
status: 'NEW',
|
||||
work_in_progress: true,
|
||||
owner: {_account_id: 0},
|
||||
},
|
||||
];
|
||||
flushAsynchronousOperations();
|
||||
let elementItems = Polymer.dom(element.root).querySelectorAll(
|
||||
'gr-change-list-item');
|
||||
assert.equal(elementItems.length, 4);
|
||||
assert.equal(elementItems.length, 5);
|
||||
for (let i = 0; i < elementItems.length; i++) {
|
||||
assert.isFalse(elementItems[i].hasAttribute('needs-review'));
|
||||
}
|
||||
@@ -243,20 +249,22 @@ limitations under the License.
|
||||
element.showReviewedState = true;
|
||||
elementItems = Polymer.dom(element.root).querySelectorAll(
|
||||
'gr-change-list-item');
|
||||
assert.equal(elementItems.length, 4);
|
||||
assert.equal(elementItems.length, 5);
|
||||
assert.isFalse(elementItems[0].hasAttribute('needs-review'));
|
||||
assert.isTrue(elementItems[1].hasAttribute('needs-review'));
|
||||
assert.isFalse(elementItems[2].hasAttribute('needs-review'));
|
||||
assert.isFalse(elementItems[3].hasAttribute('needs-review'));
|
||||
assert.isFalse(elementItems[4].hasAttribute('needs-review'));
|
||||
|
||||
element.account = {_account_id: 42};
|
||||
elementItems = Polymer.dom(element.root).querySelectorAll(
|
||||
'gr-change-list-item');
|
||||
assert.equal(elementItems.length, 4);
|
||||
assert.equal(elementItems.length, 5);
|
||||
assert.isFalse(elementItems[0].hasAttribute('needs-review'));
|
||||
assert.isTrue(elementItems[1].hasAttribute('needs-review'));
|
||||
assert.isFalse(elementItems[2].hasAttribute('needs-review'));
|
||||
assert.isFalse(elementItems[3].hasAttribute('needs-review'));
|
||||
assert.isFalse(elementItems[4].hasAttribute('needs-review'));
|
||||
});
|
||||
|
||||
test('no changes', () => {
|
||||
|
||||
Reference in New Issue
Block a user