From 12305dff37b0333bd47d6833812bc607c4e88108 Mon Sep 17 00:00:00 2001 From: Ava Wroten Date: Mon, 9 Mar 2020 09:20:44 -0500 Subject: [PATCH] All tests passing --- .../integration/components/meal-item-test.js | 19 ++++++++++++++----- .../sortable-group-accessible-test.js | 9 +-------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ember-ui/tests/integration/components/meal-item-test.js b/ember-ui/tests/integration/components/meal-item-test.js index 9ed2fe3..929eeb2 100644 --- a/ember-ui/tests/integration/components/meal-item-test.js +++ b/ember-ui/tests/integration/components/meal-item-test.js @@ -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` + + `; + test('it renders a wrapper href', async function(assert) { - await render(hbs``); + await render(defaultTemplate); assert.dom('[data-test-id=meal-link]').hasTagName('a'); }); test('it renders meal preview image', async function(assert) { - await render(hbs``); + 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``); + 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 = () => {}; } }); diff --git a/ember-ui/tests/integration/components/sortable-group-accessible-test.js b/ember-ui/tests/integration/components/sortable-group-accessible-test.js index 0b229d6..f52a34a 100644 --- a/ember-ui/tests/integration/components/sortable-group-accessible-test.js +++ b/ember-ui/tests/integration/components/sortable-group-accessible-test.js @@ -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``); - - assert.equal(this.element.textContent.trim(), ''); - + test('it can yield text content', async function(assert) { // Template block usage: await render(hbs`