Skip to content

Commit

Permalink
fix ember-test-selectors custom adapter for 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Jul 26, 2021
1 parent 719700f commit 44acddc
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 44acddc

Please sign in to comment.