Skip to content

Commit a503191

Browse files
Assert that the scale up/down indicator is not shown when the count is null
1 parent b0830f5 commit a503191

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

ui/app/models/scale-event.js

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ export default class ScaleEvent extends Fragment {
1111
@attr('boolean') error;
1212
@attr('string') evalId;
1313

14+
@computed('count', function() {
15+
return this.count != null;
16+
})
17+
hasCount;
18+
1419
@computed('count', 'previousCount', function() {
1520
return this.count > this.previousCount;
1621
})

ui/app/templates/components/scale-events-accordion.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</span>
1111
</div>
1212
<div class="column is-2">
13-
{{#if (gte a.item.count 0)}}
13+
{{#if a.item.hasCount}}
1414
<span data-test-count-icon>
1515
{{#if a.item.increased}}
1616
{{x-icon "arrow-up" class="is-danger"}}

ui/tests/integration/components/scale-events-accordion-test.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ module('Integration | Component | scale-events-accordion', function(hooks) {
9393

9494
await render(commonTemplate);
9595

96-
assert.equal(find('[data-test-count]').textContent, '');
96+
assert.notOk(find('[data-test-count]'));
97+
assert.notOk(find('[data-test-count-icon]'));
9798
});
9899

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

0 commit comments

Comments
 (0)