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.

test-data-* does not work when "tagName: ''" inside a component

See original GitHub issue

Unfortunately the automatic attribute binding of data-test-* does not work when tagName='' in a component such as ember-power-select

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
marcoowcommented, Jan 17, 2017

That would actually change the component’s rendered HTML though which would likely result in display errors when we strip the data-test-* attributes in production and the component doesn’t get wrapped in the extra div or span.

I think what we should probably do is log a warning like “You’re trying to bind a data-test-* attribute to a tagless component. The attribute will not be bound actually as there is no tag to bind it to.”.

0reactions
jackmatt2commented, Jan 17, 2017

@marcoow sounds good.

Read more comments on GitHub >

github_iconTop Results From Across the Web

test-data-* does not work when "tagName: ''" inside a component
I think what we should probably do is log a warning like "You're trying to bind a data-test-* attribute to a tagless component....
Read more >
How to set the tagName of an Ember component based data ...
This doesn't work though. The W3C specifies that you can't change the tagName of an element, so I can see why binding a...
Read more >
Test Utilities - React
Finds all DOM elements of components in the rendered tree that are DOM components with the tag name matching tagName . findRenderedDOMComponentWithTag().
Read more >
Component testing scenarios - Angular
For a use case in which TestBed.inject() does not work, see the Override component providers section that explains when and why you must...
Read more >
Best Practices - Cypress Documentation
Organizing Tests, Logging In, Controlling State; Selecting Elements ... Don't target elements based on CSS attributes such as: id , class , tag;...
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