mainmatter/ember-test-selectors

Cannot strip data-test-* attribute when binding the attribute to differently named property

tigressbailey opened this issue · 4 comments

For instance, we add below snippet in a component

attributeBindings: ['testAttr:data-test-selector'],
testAttr: computed('dataAttrPrefix', {
  get() {
    const prefix = get(this, 'prefix');
    return `${prefix}_my_selector`;
  }
}).readOnly()

In prod env, the 'data-test-selector' still exists.

try this instead:

'data-test-selector': computed('dataAttrPrefix', {
  get() {
    const prefix = get(this, 'prefix');
    return `${prefix}_my_selector`;
  }
}).readOnly()

@Turbo87 Thanks for the prompt reply.

I was wondering if the strip feature would also support the differently named property.

no, we only strip properties that start with data-test-

@Turbo87 Fair enough.