From 95e6144e44b750018784ce01a3d63d7950b1f5e5 Mon Sep 17 00:00:00 2001 From: Susmitha Girumala Date: Wed, 31 Mar 2021 15:02:17 -0400 Subject: [PATCH] test: Fix flaky origin test in desktop --- ui/desktop/tests/acceptance/origin-test.js | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/ui/desktop/tests/acceptance/origin-test.js b/ui/desktop/tests/acceptance/origin-test.js index 4d7469c45..0def4c585 100644 --- a/ui/desktop/tests/acceptance/origin-test.js +++ b/ui/desktop/tests/acceptance/origin-test.js @@ -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;