From c92f66c7c65f38f85c59f9237c3037c8ac320bbc Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Sat, 3 Oct 2020 11:36:30 -0400 Subject: [PATCH] chore: add test case for global-scope-cannot-be-fetched --- ui/core/tests/acceptance/orgs-test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ui/core/tests/acceptance/orgs-test.js b/ui/core/tests/acceptance/orgs-test.js index aaeca8356..532494519 100644 --- a/ui/core/tests/acceptance/orgs-test.js +++ b/ui/core/tests/acceptance/orgs-test.js @@ -56,6 +56,21 @@ module('Acceptance | org', function (hooks) { assert.equal(findAll('article').length, orgsCount); }); + test('visiting orgs is successful even when the global scope cannot be fetched', async function (assert) { + assert.expect(3); + this.server.get('/scopes/:id', ({ scopes }, { params: { id } }) => { + const scope = scopes.find(id); + return (id === 'global') + ? new Response(404) + : scope; + }); + await visit(urls.orgs); + await a11yAudit(); + assert.ok(orgsCount); + assert.equal(currentURL(), urls.orgs); + assert.equal(findAll('article').length, orgsCount); + }); + test('visiting scopes redirects to index', async function (assert) { assert.expect(1); await visit(urls.scopes);