test: Fix flaky origin test in desktop
This commit is contained in:
1 file changed
+14
-13
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user