Moved mock-diff-response and fix flaky tests

Moved the mock-diff-response test element to a more-appropriate location
and fixed two tests that were flaky in Safari.

Change-Id: I927973319b200021592b0c9e18c04a902f643894
This commit is contained in:
Wyatt Allen
2016-07-18 10:12:59 -07:00
parent 7d3f1a5986
commit 117d455ff0
4 changed files with 4 additions and 4 deletions

View File

@@ -50,7 +50,7 @@ limitations under the License.
test('show auth error', function(done) {
var showAuthErrorStub = sandbox.stub(element, '_showAuthErrorAlert');
element.fire('server-error', {response: {status: 403}});
flush(function() {
element.$.restAPI.getLoggedIn.lastCall.returnValue.then(function() {
assert.isTrue(showAuthErrorStub.calledOnce);
done();
});
@@ -90,7 +90,7 @@ limitations under the License.
var toastSpy = sandbox.spy(element, '_createToastAlert');
var windowOpen = sandbox.stub(window, 'open');
element.fire('server-error', {response: {status: 403}});
flush(function() {
element.$.restAPI.getLoggedIn.lastCall.returnValue.then(function() {
assert.isTrue(toastSpy.called);
var toast = toastSpy.lastCall.returnValue;
assert.isOk(toast);

View File

@@ -25,7 +25,7 @@ limitations under the License.
<script src="gr-diff-builder.js"></script>
<script src="../../../scripts/util.js"></script>
<link rel="import" href="../gr-diff-cursor/mock-diff-response_test.html">
<link rel="import" href="../../shared/gr-rest-api-interface/mock-diff-response_test.html">
<link rel="import" href="gr-diff-builder.html">
<test-fixture id="basic">

View File

@@ -25,7 +25,7 @@ limitations under the License.
<link rel="import" href="../../../bower_components/iron-test-helpers/iron-test-helpers.html">
<link rel="import" href="../gr-diff/gr-diff.html">
<link rel="import" href="./gr-diff-cursor.html">
<link rel="import" href="./mock-diff-response_test.html">
<link rel="import" href="../../shared/gr-rest-api-interface/mock-diff-response_test.html">
<test-fixture id="basic">
<template>