miguelcobain / ember-yeti-table

Yeti Table

Home Page:https://miguelcobain.github.io/ember-yeti-table

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow for data attributes to be bound to elements

hbrysiewicz opened this issue · comments

Currently unable to bind data-test-id attributes to components for use in testing.

<row.cell @data-test-id="row-actions">
 ...
</row.cell>

Should probably be allowed for data-test-id since it is so widely used in the community for testing and being style-agnostic. Probably should also be setup for other data-like attributes.

It does seem to work on:

  • <YetiTable>
  • <table.body>
  • <body.row>

It does not work on:

  • <header.column>
  • <row.cell>

I believe this is just applying ...attributes in the correct place. I have been playing with ember-sortable and will be applying modifiers to yeti-table components, ...attributes does this too.

Working on another PR, was going to include this anyway. Will let you know

So ignore that. Yeti is using component wrapper tags. Those are the ones working, however on the ones not using wrapper tags, ...attributes is applies, cell for example https://github.com/miguelcobain/ember-yeti-table/blob/master/addon/components/yeti-table/body/row/cell/template.hbs#L2

For those you if definitely have to remove the @ from data-test-id. Im surprised the @ is working though on the ones you say it is.

@cah-briangantzler row.cell does forward ...attributes. shouldn't the case illustrated by @hbrysiewicz work?

Oh. @hbrysiewicz you need to use

<row.cell data-test-id="row-actions">
 ...
</row.cell>

Without the @. Can you confirm it works?

:) Yea I said that above too. You just said it better

@cah-briangantzler & @miguelcobain That doesn't actually work with the removal of @ sign. It still does not pass through. Did you test this and have it working yourself?

Sorry for delayed reply, I must not get alerts for these things. Please let me know if you need more info.

@miguelcobain I think it must be an ember version thing. The project I'm working on is in 3.4 still and I see the ember-try config only specifies 3.8 and up... I pulled down a copy and tried running tests with 3.4 and they failed for several other reasons of course. So :( sad face. We will just have to update. Thanks 👍

You could try using https://github.com/rwjblue/ember-angle-bracket-invocation-polyfill

Not sure if addons will be affected. Best of luck!