Merge "Fix race condition in gr-reply-dialog_test.html"
This commit is contained in:
commit
27ce157cac
@ -382,21 +382,26 @@ limitations under the License.
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('only send labels that have changed', function(done) {
|
test('only send labels that have changed', function(done) {
|
||||||
var saveReviewStub = sinon.stub(element, '_saveReview',
|
flush(function() {
|
||||||
function(review) {
|
var saveReviewStub = sinon.stub(element, '_saveReview',
|
||||||
assert.deepEqual(review.labels, {Verified: -1});
|
function(review) {
|
||||||
return Promise.resolve({ok: true});
|
assert.deepEqual(review.labels, {Verified: -1});
|
||||||
});
|
return Promise.resolve({ok: true});
|
||||||
|
});
|
||||||
|
|
||||||
element.addEventListener('send', function() {
|
element.addEventListener('send', function() {
|
||||||
saveReviewStub.restore();
|
saveReviewStub.restore();
|
||||||
done();
|
done();
|
||||||
|
});
|
||||||
|
// Without wrapping this test in flush(), the below two calls to
|
||||||
|
// MockInteractions.tap() cause a race in some situations in shadow DOM.
|
||||||
|
// The send button can be tapped before the others, causing the test to
|
||||||
|
// fail.
|
||||||
|
MockInteractions.tap(element.$$(
|
||||||
|
'iron-selector[data-label="Verified"] > ' +
|
||||||
|
'gr-button[data-value="-1"]'));
|
||||||
|
MockInteractions.tap(element.$$('.send'));
|
||||||
});
|
});
|
||||||
|
|
||||||
MockInteractions.tap(element.$$(
|
|
||||||
'iron-selector[data-label="Verified"] > ' +
|
|
||||||
'gr-button[data-value="-1"]'));
|
|
||||||
MockInteractions.tap(element.$$('.send'));
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user