Skip to content

Commit

Permalink
Assert that the scale up/down indicator is not shown when the count i…
Browse files Browse the repository at this point in the history
…s null
  • Loading branch information
DingoEatingFuzz committed Jul 28, 2020
1 parent 58c563e commit cb801aa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ui/app/models/scale-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export default class ScaleEvent extends Fragment {
@attr('boolean') error;
@attr('string') evalId;

@computed('count', function() {
return this.count != null;
})
hasCount;

@computed('count', 'previousCount', function() {
return this.count > this.previousCount;
})
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/components/scale-events-accordion.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</span>
</div>
<div class="column is-2">
{{#if (gte a.item.count 0)}}
{{#if a.item.hasCount}}
<span data-test-count-icon>
{{#if a.item.increased}}
{{x-icon "arrow-up" class="is-danger"}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ module('Integration | Component | scale-events-accordion', function(hooks) {

await render(commonTemplate);

assert.equal(find('[data-test-count]').textContent, '');
assert.notOk(find('[data-test-count]'));
assert.notOk(find('[data-test-count-icon]'));
});

test('when an event has no meta properties, the accordion entry is not expandable', async function(assert) {
Expand Down

0 comments on commit cb801aa

Please sign in to comment.