Skip to content

Commit

Permalink
Merge 70ef9b4 into backport/ui/service-health-unknown-when-parent-all…
Browse files Browse the repository at this point in the history
…oc-not-running/usually-tops-midge
  • Loading branch information
hc-github-team-nomad-core committed Jun 9, 2023
2 parents db39227 + 70ef9b4 commit 9fa43a1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ui/app/components/allocation-service-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class AllocationServiceSidebarComponent extends Component {
}

get aggregateStatus() {
if (this.args.allocation?.clientStatus != -'running') return 'Unknown';
if (this.args.allocation?.clientStatus !== 'running') return 'Unknown';
return this.checks.any((check) => check.Status === 'failure')
? 'Unhealthy'
: 'Healthy';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module(
};

this.set('closeSidebar', () => this.set('service', null));
this.set('allocation', { id: 'myAlloc' });
this.set('allocation', { id: 'myAlloc', clientStatus: 'running' });
this.set('service', healthyService);
await render(
hbs`<AllocationServiceSidebar @service={{this.service}} @allocation={{this.allocation}} @fns={{hash closeSidebar=this.closeSidebar}} />`
Expand All @@ -86,6 +86,13 @@ module(
hbs`<AllocationServiceSidebar @service={{this.service}} @allocation={{this.allocation}} @fns={{hash closeSidebar=this.closeSidebar}} />`
);
assert.dom('h1 .aggregate-status').includesText('Unhealthy');

this.set('service', healthyService);
this.set('allocation', { id: 'myAlloc2', clientStatus: 'failed' });
await render(
hbs`<AllocationServiceSidebar @service={{this.service}} @allocation={{this.allocation}} @fns={{hash closeSidebar=this.closeSidebar}} />`
);
assert.dom('h1 .aggregate-status').includesText('Health Unknown');
});

test('it handles Consul services with reduced functionality', async function (assert) {
Expand Down

0 comments on commit 9fa43a1

Please sign in to comment.