Closed Bug 1006789 Opened 11 years ago Closed 11 years ago

[Messages] appendThread() doesn't have enough test coverage

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: drs, Assigned: drs)

Details

Attachments

(1 file, 1 obsolete file)

For example, we don't test if it sticks elements in the right spot in the container, and we don't test if we create a new thread if needed.
This might also make sense to punt to Oleg. PR: https://github.com/mozilla-b2g/gaia/pull/19040
Assignee: nobody → drs+bugzilla
Status: NEW → ASSIGNED
Attachment #8418948 - Flags: review?(felash)
Comment on attachment 8418948 [details] [diff] [review] Add tests for appendThread() in thread_list_ui_test.js. I'm going to preemptively move review to Oleg.
Attachment #8418948 - Flags: review?(felash) → review?(azasypkin)
Comment on attachment 8418948 [details] [diff] [review] Add tests for appendThread() in thread_list_ui_test.js. Review of attachment 8418948 [details] [diff] [review]: ----------------------------------------------------------------- ::: apps/sms/test/unit/thread_list_ui_test.js @@ +878,1 @@ > assert.isFalse(ThreadListUI.appendThread(thread)); I don't get why this passes :) (unless we don't correctly clean the environment between tests)
(In reply to Doug Sherk (:drs) from comment #2) > Comment on attachment 8418948 [details] [diff] [review] > Add tests for appendThread() in thread_list_ui_test.js. > > I'm going to preemptively move review to Oleg. Oleg is not (yet) a peer of the SMS app, therefore you can't ask him directly yourself. In this specific case, I'm gonna let him do this review, but I don't want to relax these rules otherwise soon anybody will request a review to anybody.
(In reply to Julien Wajsberg [:julienw] from comment #3) > Comment on attachment 8418948 [details] [diff] [review] > Add tests for appendThread() in thread_list_ui_test.js. > > Review of attachment 8418948 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: apps/sms/test/unit/thread_list_ui_test.js > @@ +878,1 @@ > > assert.isFalse(ThreadListUI.appendThread(thread)); > > I don't get why this passes :) > > (unless we don't correctly clean the environment between tests) insertMockMarkup() inserts threads with ids 1 and 2, so we're appending this thread to thread 2, whereas in the previous suite we're creating a new thread with id 3. (In reply to Julien Wajsberg [:julienw] from comment #4) > Oleg is not (yet) a peer of the SMS app, therefore you can't ask him > directly yourself. > > In this specific case, I'm gonna let him do this review, but I don't want to > relax these rules otherwise soon anybody will request a review to anybody. Sorry, you seemed swamped and I was pretty sure you'd end up giving it to him anyways. It wasn't at all intended to bypass our process.
Comment on attachment 8418948 [details] [diff] [review] Add tests for appendThread() in thread_list_ui_test.js. Review of attachment 8418948 [details] [diff] [review]: ----------------------------------------------------------------- Looks good, we can also test the case when we call 'appendThread' while ThreadListUI is in the edit mode. Thanks! ::: apps/sms/test/unit/thread_list_ui_test.js @@ +848,5 @@ > }); > > + test('show up in same container', function() { > + assert.isFalse(ThreadListUI.appendThread(thread)); > + var newContainerId = 'threadsContainer_' + (+someDate); nit: it's more 'existingContainer'\'container' then 'newContainer' now. @@ +877,1 @@ > test('should return false when adding to existing thread', function() { Why do we need this test? Seems that we have the same test in the previous suite.
Attachment #8418948 - Flags: review?(azasypkin) → review+
(In reply to Oleg Zasypkin [:azasypkin] from comment #6) > Why do we need this test? Seems that we have the same test in the previous > suite. The test in the previous suite appends twice and checks if the first one returned true, then the second returned false. This one checks if it's false only. I notice that the test directly above this one contains the same check (maybe you were referring to that?), but I think it's reasonable to leave this anyways since it'll make more clear what's going wrong if there's a problem. What I did instead is remove the check in the above test. Updated PR. Will wait for green then merge.
Attachment #8418948 - Attachment is obsolete: true
Attachment #8421168 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: