-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix ember-test-selectors custom adapter for 6.x
- Loading branch information
Showing
1 changed file
with
7 additions
and
5 deletions.
There are no files selected for viewing
12 changes: 7 additions & 5 deletions
12
packages/compat/src/compat-adapters/ember-test-selectors.ts
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,12 +1,14 @@ | ||
import V1Addon from '../v1-addon'; | ||
import { forceIncludeModule } from '../compat-utils'; | ||
import semver from 'semver'; | ||
|
||
export default class extends V1Addon { | ||
// v6.0.0 of ember-test-selectors dropped the attribute binding for classic components | ||
static shouldApplyAdapter(addonInstance: any) { | ||
return semver.lt(addonInstance.pkg.version, '6.0.0') && !addonInstance._stripTestSelectors; | ||
} | ||
|
||
get packageMeta() { | ||
if (this.addonInstance._stripTestSelectors) { | ||
return super.packageMeta; | ||
} else { | ||
return forceIncludeModule(super.packageMeta, './utils/bind-data-test-attributes'); | ||
} | ||
return forceIncludeModule(super.packageMeta, './utils/bind-data-test-attributes'); | ||
} | ||
} |