test: Fix flaky origin test in desktop

This commit is contained in:
Susmitha Girumala committed 2021-03-31 15:02:17 -04:00
1 parent 73503f98dc
commit 95e6144e44
1 file changed
+14 -13
+14 -13
View File
@@ -157,15 +157,28 @@ module('Acceptance | origin', function (hooks) {
});
test('can set origin', async function (assert) {
assert.expect(2);
assert.expect(3);
assert.notOk(mockIPC.origin);
await visit(urls.origin);
await a11yAudit();
await fillIn('[name="host"]', window.location.origin);
await click('[type="submit"]');
assert.equal(currentURL(), urls.authenticate.methods.global);
assert.equal(mockIPC.origin, window.location.origin);
});
test('can reset origin before authentication', async function (assert) {
assert.expect(4);
assert.notOk(mockIPC.origin);
await visit(urls.origin);
await fillIn('[name="host"]', window.location.origin);
await click('[type="submit"]');
assert.equal(currentURL(), urls.authenticate.methods.global);
assert.equal(mockIPC.origin, window.location.origin);
await click('.change-origin a');
assert.equal(currentURL(), urls.origin);
});
test('captures error on origin update', async function (assert) {
assert.expect(2);
assert.notOk(mockIPC.origin);
@@ -177,18 +190,6 @@ module('Acceptance | origin', function (hooks) {
assert.ok(find('.rose-notification.is-error'));
});
test('can reset origin before authentication', async function (assert) {
assert.expect(4);
assert.notOk(mockIPC.origin);
await visit(urls.origin);
await fillIn('[name="host"]', window.location.origin);
await click('[type="submit"]');
assert.equal(mockIPC.origin, window.location.origin);
assert.equal(currentURL(), urls.authenticate.methods.global);
await click('.change-origin a');
assert.equal(currentURL(), urls.origin);
});
test('origin set automatically in dev mode', async function (assert) {
assert.expect(1);
config.autoOrigin = true;