Skip to content

Commit

Permalink
Merge pull request #904 from mydea/fn/fix-test-selectors
Browse files Browse the repository at this point in the history
Fix ember-test-selectors custom adapter for 6.x
  • Loading branch information
rwjblue authored Jul 28, 2021
2 parents 8518888 + 44acddc commit 30580a9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/compat/src/compat-adapters/ember-test-selectors.ts
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');
}
}

0 comments on commit 30580a9

Please sign in to comment.