open-vault/ui/tests/integration/components/nav-header-test.js
Matthew Irish d509588cd2
Ember update (#5386)
Ember update - update ember-cli, ember-data, and ember to 3.4 series
2018-09-25 11:28:26 -05:00

42 lines
1.2 KiB
JavaScript

import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { create } from 'ember-cli-page-object';
import hbs from 'htmlbars-inline-precompile';
import navHeader from 'vault/tests/pages/components/nav-header';
const component = create(navHeader);
module('Integration | Component | nav header', function(hooks) {
setupRenderingTest(hooks);
hooks.beforeEach(function() {
component.setContext(this);
});
hooks.afterEach(function() {
component.removeContext();
});
test('it renders', async function(assert) {
await render(hbs`
{{#nav-header as |h|}}
{{#h.home}}
Home!
{{/h.home}}
{{#h.items}}
Some Items
{{/h.items}}
{{#h.main}}
Main stuff here
{{/h.main}}
{{/nav-header}}
`);
assert.ok(component.ele, 'renders the outer element');
assert.equal(component.homeText.trim(), 'Home!', 'renders home content');
assert.equal(component.itemsText.trim(), 'Some Items', 'renders items content');
assert.equal(component.mainText.trim(), 'Main stuff here', 'renders items content');
});
});