Skip to content

Commit

Permalink
Previous alloc legend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
philrenaud committed Apr 18, 2023
1 parent 258c237 commit 50cf21e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ui/app/components/job-status/panel/deploying.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<div class="previous-allocations">
<JobStatus::AllocationStatusRow @allocBlocks={{this.oldVersionAllocBlocks}} @steady={{true}} />
</div>
<div class="legend-and-summary">
<div class="legend-and-summary" data-test-previous-allocations-legend>
<legend>
<span class="legend-item {{if (eq (get this.oldRunningHealthyAllocBlocks "length") 0) "faded"}}">
<span class="represented-allocation running"></span>
Expand All @@ -61,7 +61,7 @@
</div>
</div>

<div class="legend-and-summary">
<div class="legend-and-summary" data-test-new-allocations-legend>

{{!-- Legend by Status, then by Health, then by Canary --}}
<legend>
Expand Down
16 changes: 15 additions & 1 deletion ui/tests/integration/components/job-status-panel-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module(
});

test('the latest deployment section shows up for the currently running deployment: Ungrouped Allocations (small cluster)', async function (assert) {
assert.expect(23);
assert.expect(25);

this.server.create('node');

Expand Down Expand Up @@ -313,6 +313,13 @@ module(
'Old Alloc Summary text shows accurate numbers'
);

assert.equal(
find('[data-test-previous-allocations-legend]')
.textContent.trim()
.replace(/\s\s+/g, ' '),
'25 Running 0 Complete'
);

// Try setting a few of the old allocs to complete and make sure number ticks down
await Promise.all(
this.get('job.allocations')
Expand Down Expand Up @@ -354,6 +361,13 @@ module(
'Old Alloc Summary text shows accurate numbers after some are marked complete'
);

assert.equal(
find('[data-test-previous-allocations-legend]')
.textContent.trim()
.replace(/\s\s+/g, ' '),
'20 Running 5 Complete'
);

await componentA11yAudit(
this.element,
assert,
Expand Down

0 comments on commit 50cf21e

Please sign in to comment.