consul/ui-v2/tests/integration/components/stats-card-test.js
John Cowen d01ef7225a ui: Add stats-card component, integrate more @hashicorp/structure-icons (#6021)
1. Rebuild the heathchecked-resource component now we can copy and paste
2. As the above rebuild came with new icons, we also swapped out 'most'
of the other areas where we were using these new icons, plus any icons
that were effected by the new icon placeholders
3. Begin to remove more and more of the project specific icons (now
replaced by the shared ones)
2019-09-04 08:35:11 +00:00

36 lines
934 B
JavaScript

import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('stats-card', 'Integration | Component | stats card', {
integration: true,
});
test('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
// Template block usage:
this.render(hbs`
{{#stats-card}}
{{#block-slot 'icon'}}icon{{/block-slot}}
{{#block-slot 'mini-stat'}}mini-stat{{/block-slot}}
{{#block-slot 'header'}}header{{/block-slot}}
{{#block-slot 'body'}}body{{/block-slot}}
{{/stats-card}}
`);
['icon', 'mini-stat', 'header'].forEach(item => {
assert.ok(
this.$('header')
.text()
.trim()
.indexOf(item) !== -1
);
});
assert.ok(
this.$()
.text()
.trim()
.indexOf('body') !== -1
);
});