ciena-frost / ember-frost-info-bar

A generic info bar pattern with title+subtitle+action button
http://ciena-frost.github.io/ember-frost-info-bar/
MIT License
2 stars 16 forks source link

Discuss where we see the value of hooks during testing #54

Open juwara0 opened 7 years ago

juwara0 commented 7 years ago

Right now, we are getting a hook set on icon: https://github.com/ciena-frost/ember-frost-info-bar/blob/21648cdc15f8fa46afc54f860a3f8de14c66f35a/addon/templates/components/frost-info-bar.hbs#L3

Does this provide the value we want?

Would a tester rather be setting a hook on the icon component https://github.com/ciena-frost/ember-frost-info-bar/blob/21648cdc15f8fa46afc54f860a3f8de14c66f35a/addon/templates/components/frost-info-bar.hbs#L4 which gets applied to the <svg>.

juwara0 commented 7 years ago

Another area we should evaluate updating: https://github.com/ciena-frost/ember-frost-info-bar/blob/21648cdc15f8fa46afc54f860a3f8de14c66f35a/addon/templates/components/frost-info-bar.hbs#L10-L16

{{#if (type-of title 'object')}}
  <div class='primary-title'>
    {{component title}}
  </div>
{{else}}
  <div class='primary-title' data-test={{hook (concat hook '-title')}}>
    {{title}}
  </div>
{{/if}}
job13er commented 7 years ago

Discussed in slack and @sglanzer agrees, the components should be getting hooks set on them. I'm opening an issue to that effect right now.

While the consumer probably doesn't care about some of the hooks, the component itself might care. For instance, if the frost-icon needs to be wrapped by a <div> with a particular class set on it, this component's tests should be able to grab that <div> with a hook.

notmessenger commented 6 years ago

JIRA: https://agile-jira.ciena.com/browse/FROST-771