-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure resize service is present in tests
- Loading branch information
1 parent
a220271
commit b7a518b
Showing
7 changed files
with
56 additions
and
12 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
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,16 @@ | ||
import { currentURL, find, visit } from '@ember/test-helpers'; | ||
import { EmberApplicationTest } from 'ember-qunit-decorators/test-support'; | ||
import { suite, test } from 'qunit-decorators'; | ||
|
||
@suite('Acceptance | index') | ||
export class IndexAcceptanceTest extends EmberApplicationTest { | ||
|
||
@test async 'visiting /'(assert: Assert) { | ||
await visit('/'); | ||
assert.equal(currentURL(), '/'); | ||
|
||
const codeElement: Element | null = find('.index-view code'); | ||
if (codeElement === null) { throw new Error('no <code>'); } | ||
assert.ok(/min\-width:\s[0-9]+px/.test('' + codeElement.textContent), 'min-width text found'); | ||
} | ||
} |
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,5 +1,7 @@ | ||
import Component from '@ember/component'; | ||
import { inject } from '@ember/service'; | ||
|
||
export default Component.extend({ | ||
classNames: ['test-component'] | ||
classNames: ['test-component'], | ||
resize: inject() | ||
}); |
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,28 @@ | ||
import { render } from '@ember/test-helpers'; | ||
import { EmberRenderingTest } from 'ember-qunit-decorators/test-support'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
import { suite, test } from 'qunit-decorators'; | ||
|
||
@suite('Integration | Component | x-foo') | ||
export class XFooComponentTest extends EmberRenderingTest { | ||
|
||
@test async 'it renders when used in {{inline-form}}'(assert: Assert) { | ||
// Set any properties with this.set('myProperty', 'value'); | ||
// Handle any actions with this.set('myAction', function(val) { ... }); | ||
|
||
await render(hbs`{{x-foo}}`); | ||
|
||
assert.equal(('' + this.element.textContent).trim(), ''); | ||
} | ||
|
||
@test async 'it renders when used in {{#block-form}} {{/block-form}}'(assert: Assert) { | ||
// Template block usage: | ||
await render(hbs` | ||
{{#x-foo}} | ||
template block text | ||
{{/x-foo}} | ||
`); | ||
|
||
assert.equal(('' + this.element.textContent).trim(), 'template block text'); | ||
} | ||
} |
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
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
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 @@ | ||
declare module "dummy/initializers/resize"; |