-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ilya Radchenko
committed
Dec 22, 2018
1 parent
2355b6b
commit feed19e
Showing
3 changed files
with
224 additions
and
218 deletions.
There are no files selected for viewing
32 changes: 17 additions & 15 deletions
32
tests/integration/components/x-toggle-label/component-test.js
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 |
---|---|---|
@@ -1,22 +1,24 @@ | ||
import { moduleForComponent, test } from 'ember-qunit'; | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { render, find } from '@ember/test-helpers'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
moduleForComponent('x-toggle-label', 'Integration | Component | x toggle label', { | ||
integration: true | ||
}); | ||
module('Integration | Component | x toggle label', function(hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('it renders', function(assert) { | ||
this.render(hbs`{{x-toggle-label label='test' value=true switchId='test' show=true}}`); | ||
test('it renders', async function(assert) { | ||
await render(hbs`{{x-toggle-label label='test' value=true switchId='test' show=true}}`); | ||
|
||
assert.equal(this.$().text().trim(), 'test'); | ||
}); | ||
assert.equal(find('*').textContent.trim(), 'test'); | ||
}); | ||
|
||
test('it renders in block form', function(assert) { | ||
this.render(hbs` | ||
{{#x-toggle-label label='test' value=true switchId='test' show=true as |value|}} | ||
hi {{value}} | ||
{{/x-toggle-label}} | ||
`); | ||
test('it renders in block form', async function(assert) { | ||
await render(hbs` | ||
{{#x-toggle-label label='test' value=true switchId='test' show=true as |value|}} | ||
hi {{value}} | ||
{{/x-toggle-label}} | ||
`); | ||
|
||
assert.equal(this.$().text().trim(), 'hi test'); | ||
assert.equal(find('*').textContent.trim(), 'hi test'); | ||
}); | ||
}); |
18 changes: 10 additions & 8 deletions
18
tests/integration/components/x-toggle-switch/component-test.js
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 |
---|---|---|
@@ -1,13 +1,15 @@ | ||
import { moduleForComponent, test } from 'ember-qunit'; | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { render, find } from '@ember/test-helpers'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
moduleForComponent('x-toggle-switch', 'Integration | Component | x toggle switch', { | ||
integration: true | ||
}); | ||
module('Integration | Component | x toggle switch', function(hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('it renders', function(assert) { | ||
this.set('sendToggle', () => {}); | ||
this.render(hbs`{{x-toggle-switch sendToggle=(action sendToggle)}}`); | ||
test('it renders', async function(assert) { | ||
this.set('sendToggle', () => {}); | ||
await render(hbs`{{x-toggle-switch sendToggle=(action sendToggle)}}`); | ||
|
||
assert.equal(this.$().text().trim(), ''); | ||
assert.equal(find('*').textContent.trim(), ''); | ||
}); | ||
}); |
Oops, something went wrong.