2018-09-25 16:28:26 +00:00
|
|
|
import { module, test } from 'qunit';
|
|
|
|
import { setupRenderingTest } from 'ember-qunit';
|
|
|
|
import { render } from '@ember/test-helpers';
|
2018-06-26 21:35:47 +00:00
|
|
|
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);
|
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
module('Integration | Component | nav header', function(hooks) {
|
|
|
|
setupRenderingTest(hooks);
|
2018-06-26 21:35:47 +00:00
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
hooks.beforeEach(function() {
|
2018-06-26 21:35:47 +00:00
|
|
|
component.setContext(this);
|
2018-09-25 16:28:26 +00:00
|
|
|
});
|
2018-06-26 21:35:47 +00:00
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
hooks.afterEach(function() {
|
2018-06-26 21:35:47 +00:00
|
|
|
component.removeContext();
|
2018-09-25 16:28:26 +00:00
|
|
|
});
|
2018-06-26 21:35:47 +00:00
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
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}}
|
|
|
|
`);
|
2018-06-26 21:35:47 +00:00
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
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');
|
|
|
|
});
|
2018-06-26 21:35:47 +00:00
|
|
|
});
|