feat: 🎸 Add fallback if client daemon is down or errors (#2085)
* feat: 🎸 Add fallback if client daemon is down or errors * test: 💍 Add tests for client daemon being down ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12026
This commit is contained in:
1 parent
9046c01238
commit
2e36d3c3e2
8 files changed
+195
-119
No files matched your search
@@ -180,6 +180,7 @@ module('Acceptance | projects | sessions | index', function (hooks) {
|
||||
await click(`[href="${urls.sessions}"]`);
|
||||
|
||||
assert.strictEqual(currentURL(), urls.sessions);
|
||||
assert.dom('.hds-segmented-group').exists();
|
||||
assert.dom('tbody tr').exists({ count: sessionsCount });
|
||||
});
|
||||
|
||||
@@ -398,4 +399,16 @@ module('Acceptance | projects | sessions | index', function (hooks) {
|
||||
.dom(`[data-test-session-detail-link="${instances.session2.id}"]`)
|
||||
.isVisible();
|
||||
});
|
||||
|
||||
test('sessions list view still loads with no client daemon', async function (assert) {
|
||||
this.ipcStub.withArgs('isClientDaemonRunning').returns(false);
|
||||
this.stubClientDaemonSearch();
|
||||
const sessionsCount = this.server.schema.sessions.all().models.length;
|
||||
|
||||
await visit(urls.globalSessions);
|
||||
|
||||
assert.dom('.hds-segmented-group').doesNotExist();
|
||||
assert.strictEqual(currentURL(), urls.globalSessions);
|
||||
assert.dom('tbody tr').exists({ count: sessionsCount });
|
||||
});
|
||||
});
|
||||
@@ -177,6 +177,7 @@ module('Acceptance | projects | targets | index', function (hooks) {
|
||||
await click(`[href="${urls.targets}"]`);
|
||||
await a11yAudit();
|
||||
|
||||
assert.dom('.hds-segmented-group').exists();
|
||||
assert.strictEqual(currentURL(), urls.targets);
|
||||
assert.strictEqual(getTargetCount(), targetsCount);
|
||||
});
|
||||
@@ -455,4 +456,18 @@ module('Acceptance | projects | targets | index', function (hooks) {
|
||||
.dom(`[data-test-target-project-id="${instances.scopes.project2.id}"]`)
|
||||
.doesNotExist();
|
||||
});
|
||||
|
||||
test('targets list view still loads with no client daemon', async function (assert) {
|
||||
this.ipcStub.withArgs('isClientDaemonRunning').returns(false);
|
||||
this.stubClientDaemonSearch();
|
||||
const targetsCount = getTargetCount();
|
||||
|
||||
await visit(urls.projects);
|
||||
|
||||
await click(`[href="${urls.targets}"]`);
|
||||
|
||||
assert.dom('.hds-segmented-group').doesNotExist();
|
||||
assert.strictEqual(currentURL(), urls.targets);
|
||||
assert.dom('tbody tr').exists({ count: targetsCount });
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user