You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/ui-v2/tests/integration/components/stats-card-test.js

36 lines
1.1 KiB

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