Closed Bug 1092812 Opened 11 years ago Closed 11 years ago

Test method assertHighlight is not really asserting if there are nodes highlighted

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1088706

People

(Reporter: pedro.cambra, Assigned: pedro.cambra, Mentored)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:36.0) Gecko/20100101 Firefox/36.0 Build ID: 20141101030205 Steps to reproduce: Run assertHighlight with any string that should be not found, such as: assertHighlight('LALALA'); Actual results: Test passes Expected results: Test should fail
Mentor: francisco
Working on this
This is going to break all tests that were relying blindly on assertHighlight. Opening a new bug for this
Attachment #8515624 - Flags: review?(francisco)
See Also: → 1092816
I have been researching a bit about this bug (didn't know you were already working on it) and I can see that your patch makes obvious that the tests are checking anything. What worries me is that searchList.getElementsByClassName(highlightClass) never returns any node, and I don't know why, but it can have something to do with highlighting using clones of the nodes and not the real nodes. I think tests should be passing once assertHighlight is fixed, because the problem relies on this function.
Flags: needinfo?(pedro.cambra)
Blocks: 1088706
I've opened an additional bug for fixing the tests (referenced above: 1092816). As you say, searchList.getElementsByClassName(highlightClass) never returns any node. That's because, in the tests (and just there), the highlight span is never added to the text. I was working on that in 1092816
Flags: needinfo?(pedro.cambra)
I saw you can't assign yourself to bugs so I assigned you. I also set 1092816 as a blocker for this bug. Please feel free to ask if you want to change something else or revert some of these changes I made. Thanks a lot for your work!
Assignee: nobody → pedro.cambra
Status: UNCONFIRMED → NEW
Depends on: 1092816
Ever confirmed: true
I've been researching a bit more and I am doing a little refactor of the search tests in this test file because I've seen several worrying issues with them. I will add the refactor to my pull request in bug 1088706.
we are fixing this on bug 1088706
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
No longer blocks: 1088706
Comment on attachment 8515624 [details] [review] Adding a check on how much nodes were actually highlighted Removing the review flag
Attachment #8515624 - Flags: review?(francisco)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: