chore: add test case for global-scope-cannot-be-fetched

This commit is contained in:
Randall Morey committed 2020-10-03 11:36:30 -04:00
1 parent ee9bb281c1
commit c92f66c7c6
1 file changed
+15
+15
View File
@@ -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);