-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test - image-cover component
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { render, find } from '@ember/test-helpers'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
module('Integration | Component | image cover', function(hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('renders image-cover', async function(assert) { | ||
// Set any properties with this.set('myProperty', 'value'); | ||
// Handle any actions with this.on('myAction', function(val) { ... }); | ||
|
||
await render(hbs`{{image-cover name='akira'}}`); | ||
|
||
assert.notEqual(find('img'), null); | ||
assert.ok(find('img').classList.contains('cover')); | ||
assert.ok(find('img').src.indexOf("/assets/images/comics/covers/akira.jpg") >= 0); | ||
}); | ||
|
||
test('renders image-cover - root is image', async function(assert) { | ||
// Set any properties with this.set('myProperty', 'value'); | ||
// Handle any actions with this.on('myAction', function(val) { ... }); | ||
|
||
await render(hbs`{{image-cover name='akira'}}`); | ||
|
||
assert.ok(this.element.firstElementChild.tagName === 'IMG'); | ||
assert.ok(this.element.firstElementChild.classList.contains('cover')); | ||
assert.ok(this.element.firstElementChild.src.indexOf("/assets/images/comics/covers/akira.jpg") >= 0); | ||
}); | ||
}); |