Closed Bug 1170653 Opened 10 years ago Closed 10 years ago

[Music] [Front-end] Add unit tests for ui/tab_bar.js

Categories

(Firefox OS Graveyard :: Gaia::Music, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(b2g-v2.2 wontfix, b2g-master fixed)

RESOLVED FIXED
FxOS-S2 (10Jul)
Tracking Status
b2g-v2.2 --- wontfix
b2g-master --- fixed

People

(Reporter: dkuo, Assigned: hub)

References

Details

Attachments

(1 file)

Currently ui/tab_bar.js lacks for the unit tests so let's add them.
This should be the first one. While this are really "unit" the are run by the marionette tests because I need the UI to be set up.
Assignee: nobody → hub
Status: NEW → ASSIGNED
Attachment #8623918 - Flags: review?(dkuo)
Bug 1161492 will break this. So the order of landing will impact.
Hub, In fact, I don't know what's a suitable way to write unit tests that html involved, so I tried to look what's existing in the gaia repository then found a similar case in clock app [1], do you think we can also use this approach or keep what you have in your patch? thanks. [1] https://github.com/mozilla-b2g/gaia/blob/master/apps/clock/test/unit/tabs_test.js
Flags: needinfo?(hub)
I missed that example. That's a valid approach, but I don't think, that for us, it provides any more coverage than what I did using our actual HTML. My approach test also the fact we still match the document model with the code. I'm not opposed to use the other approach. Let's see if that can be done,
Flags: needinfo?(hub)
Comment on attachment 8623918 [details] [review] Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/30639 Let's have Jim to also comment on this :)
Attachment #8623918 - Flags: review?(dkuo)
Flags: needinfo?(squibblyflabbetydoo)
I have updated the pull request to provide an alternative test done as suggested in comment 3. Only minor caveat: I had to change the widget to actually listen to the 'click' events as well.
Comment on attachment 8623918 [details] [review] Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/30639 Dominic, This is the alternative testing method you suggested. I think it is better too. Thanks.
Attachment #8623918 - Flags: review?(dkuo)
Comment on attachment 8623918 [details] [review] Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/30639 Cancelling review. I found out I have added duplicated mocks.... I'll rework it to use the existing ones.
Attachment #8623918 - Flags: review?(dkuo)
Comment on attachment 8623918 [details] [review] Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/30639 This time we should be alright.
Attachment #8623918 - Flags: review?(dkuo)
Comment on attachment 8623918 [details] [review] Link to Github pull-request: https://github.com/mozilla-b2g/gaia/pull/30639 Hub, thanks for working on this. The patch looks good to me with some minor issues, I have left the comments on github and please address them before landing it.
Attachment #8623918 - Flags: review?(dkuo) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: needinfo?(squibblyflabbetydoo) → in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S2 (10Jul)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: