Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix New Style testing helpers usage to support integration tests
- Loading branch information
Sergey Astapov
committed
Feb 27, 2018
1 parent
3f05c80
commit af0cd86
Showing
5 changed files
with
14 additions
and
7 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,4 @@ | ||
export function _enableFeature(owner, featureName) { | ||
let featuresService = owner.lookup('service:features'); | ||
featuresService.enable(featureName); | ||
} |
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,6 +1,6 @@ | ||
import { registerHelper } from '@ember/test'; | ||
import { enableFeature } from '../index'; | ||
import { _enableFeature } from '../-private/enable-feature'; | ||
|
||
registerHelper('withFeature', function withFeature(app, featureName) { | ||
enableFeature(app.__container__, featureName); | ||
_enableFeature(app.__deprecatedInstance__, featureName); | ||
}); |
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,4 +1,7 @@ | ||
export function enableFeature(owner, featureName) { | ||
let featuresService = owner.lookup('service:features'); | ||
featuresService.enable(featureName); | ||
import { getContext } from '@ember/test-helpers'; | ||
import { _enableFeature } from './-private/enable-feature'; | ||
|
||
export function enableFeature(featureName) { | ||
let { owner } = getContext(); | ||
_enableFeature(owner, featureName); | ||
} |
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