All tests passing
This commit is contained in:
parent
726b65b7f3
commit
12305dff37
2 changed files with 15 additions and 13 deletions
|
@ -4,26 +4,33 @@ import { setupMirage } from 'ember-cli-mirage/test-support';
|
|||
import { render } from '@ember/test-helpers';
|
||||
import { hbs } from 'ember-cli-htmlbars';
|
||||
|
||||
module('Integration | Component | meal-preview', function(hooks) {
|
||||
module('Integration | Component | meal-item', function(hooks) {
|
||||
setupRenderingTest(hooks);
|
||||
setupMirage(hooks);
|
||||
|
||||
hooks.beforeEach(initMeal);
|
||||
|
||||
const defaultTemplate = hbs`
|
||||
<MealItem
|
||||
@meal={{meal}}
|
||||
@handleFocus={{handleFocus}}
|
||||
@handleBlur={{handleBlur}} />
|
||||
`;
|
||||
|
||||
test('it renders a wrapper href', async function(assert) {
|
||||
await render(hbs`<MealItem @meal={{meal}} />`);
|
||||
await render(defaultTemplate);
|
||||
|
||||
assert.dom('[data-test-id=meal-link]').hasTagName('a');
|
||||
});
|
||||
|
||||
test('it renders meal preview image', async function(assert) {
|
||||
await render(hbs`<MealItem @meal={{meal}} />`);
|
||||
await render(defaultTemplate);
|
||||
|
||||
assert.dom('[data-test-id=meal-preview-image]').hasAttribute('src', 'image.jpg');
|
||||
});
|
||||
|
||||
test('it renders meal data as text', async function(assert) {
|
||||
await render(hbs`<MealItem @meal={{meal}} />`);
|
||||
await render(defaultTemplate);
|
||||
|
||||
assert.dom('[data-test-id=meal-name]').hasText('Cookies');
|
||||
assert.dom('[data-test-id=meal-ingredients-list]').hasText('Love, Chocolate');
|
||||
|
@ -49,6 +56,8 @@ module('Integration | Component | meal-preview', function(hooks) {
|
|||
name: 'Cookies',
|
||||
thumbnailUrl: 'image.jpg',
|
||||
});
|
||||
this.set('meal', await store.findRecord('meal', 1));
|
||||
this.meal = await store.findRecord('meal', 1);
|
||||
this.handleFocus = () => {};
|
||||
this.handleBlur = () => {};
|
||||
}
|
||||
});
|
||||
|
|
|
@ -6,14 +6,7 @@ import { hbs } from 'ember-cli-htmlbars';
|
|||
module('Integration | Component | sortable-group-accessible', 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`<SortableGroupAccessible />`);
|
||||
|
||||
assert.equal(this.element.textContent.trim(), '');
|
||||
|
||||
test('it can yield text content', async function(assert) {
|
||||
// Template block usage:
|
||||
await render(hbs`
|
||||
<SortableGroupAccessible>
|
||||
|
|
Loading…
Add table
Reference in a new issue