question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

data-test-* attributes without values on components cause build error

See original GitHub issue

In the release notes for v0.2.0 it states

Added support for data-test-* attributes without values on components

I’m using:

ember-cli: 2.11.1
ember: 2.11.2
ember-test-selectors: 0.2.1

If I do the following

{{my-component data-test-special-button}}

I get a Build Error with:

Expecting 'EQUALS'

The current workaround is:

{{my-component data-test-special-button=true}}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
Turbo87commented, Mar 6, 2017

We are handling data-test-number-spinner as a positional parameter here and are transforming it into data-test-number-spinner=true in an AST transform. The parser initially sees it as a position parameter though and positional parameter have to be written before named parameters.

If you change

{{#if showNumberSpinner}}
  {{number-spinner disabled=isDisabled value=currentValue min=min max=max update=(action "updateNumber") data-test-number-spinner}}
{{/if}}

to

{{#if showNumberSpinner}}
  {{number-spinner data-test-number-spinner disabled=isDisabled value=currentValue min=min max=max update=(action "updateNumber")}}
{{/if}}

it should work.

2reactions
Turbo87commented, Mar 6, 2017

whaaaaaaat, there is a facepalm emoji on GitHub now?!? 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript error for data-* attributes on MaterialUI React ...
I am trying to pass a data-testid attribute to a Material-UI Select component, but I am getting the following Typescript error:.
Read more >
data-* attributes being stripped from certain comopnents #3210
will not result in a div in the dom with a data-test attribute. I think that data-attibutes should be able to be most...
Read more >
What is the data-testid attribute in testing? - Educative.io
data-testid is an attribute used to identify a DOM node for testing purposes. ... value is unique. Therefore, we do not cause conflicts...
Read more >
A Complete Guide to Data Attributes | CSS-Tricks
Everything you ever wanted to know about data attributes in HTML, CSS, and JavaScript.
Read more >
HTMLElement.dataset - Web APIs | MDN
In JavaScript. The property name of a custom data attribute is the same as the HTML attribute without the data- prefix, and removes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found