open-vault/ui/tests/integration/components/empty-state-test.js

44 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-11-02 20:17:02 +00:00
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
2018-11-03 17:21:49 +00:00
import { render, find } from '@ember/test-helpers';
2018-11-02 20:17:02 +00:00
import hbs from 'htmlbars-inline-precompile';
module('Integration | Component | empty-state', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`{{empty-state}}`);
assert.equal(this.element.textContent.trim(), '');
// Template block usage:
await render(hbs`
2018-11-03 17:21:49 +00:00
{{#empty-state
title="Empty State Title"
message="This is the empty state message"
}}
Actions Link
2018-11-02 20:17:02 +00:00
{{/empty-state}}
`);
2018-11-03 17:21:49 +00:00
assert.equal(
find('.empty-state-title').textContent.trim(),
'Empty State Title',
'renders empty state title'
);
assert.equal(
find('.empty-state-message').textContent.trim(),
'This is the empty state message',
'renders empty state message'
);
assert.equal(
find('.empty-state-actions').textContent.trim(),
'Actions Link',
'renders empty state actions'
);
2018-11-02 20:17:02 +00:00
});
});