Merge lp:~deryck/launchpad/fix-me-too-unit-test-491441 into lp:launchpad/db-devel

Proposed by Deryck Hodge
Status: Merged
Approved by: Edwin Grubbs
Approved revision: not available
Merge reported by: Deryck Hodge
Merged at revision: not available
Proposed branch: lp:~deryck/launchpad/fix-me-too-unit-test-491441
Merge into: lp:launchpad/db-devel
Diff against target: 30 lines (+3/-3)
1 file modified
lib/canonical/launchpad/javascript/bugs/tests/test_me_too.js (+3/-3)
To merge this branch: bzr merge lp:~deryck/launchpad/fix-me-too-unit-test-491441
Reviewer Review Type Date Requested Status
Edwin Grubbs (community) code Approve
Review via email: mp+15561@code.launchpad.net

Commit message

Make the me too JavaScript unit test pass again.

To post a comment you must log in.
Revision history for this message
Deryck Hodge (deryck) wrote :

This branch fixes the JavaScript unit test for the "affects me too" feature. This is bug 491441.

Four of the tests in the module were broken because the click to open the overlay was never completed, since the test used mousedown. The fix is to simply use a click event. Now all the tests pass.

To run the test:

firefox lib/canonical/launchpad/javascript/bugs/tests/test_me_too.js

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Looks good.

merge-approved

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/javascript/bugs/tests/test_me_too.js'
2--- lib/canonical/launchpad/javascript/bugs/tests/test_me_too.js 2009-11-25 19:21:59 +0000
3+++ lib/canonical/launchpad/javascript/bugs/tests/test_me_too.js 2009-12-09 19:26:16 +0000
4@@ -128,7 +128,7 @@
5 * negative choice (i.e. "Does not affect me").
6 */
7 test_flame_hidden_with_negative_choice: function() {
8- simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown');
9+ simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
10 simulate(this.choice_edit._choice_list.get('boundingBox'),
11 'li a[href$=false]', 'click');
12 var flame_icon = this.choice_edit.get('flame_icon');
13@@ -140,7 +140,7 @@
14 * positive choice (i.e. "Affects me too").
15 */
16 test_flame_hidden_with_positive_choice: function() {
17- simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown');
18+ simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
19 simulate(this.choice_edit._choice_list.get('boundingBox'),
20 'li a[href$=true]', 'click');
21 var flame_icon = this.choice_edit.get('flame_icon');
22@@ -177,7 +177,7 @@
23 "The edit icon is displaying a spinner at rest.");
24 // The spinner should not be displayed after opening the
25 // choice list.
26- simulate(this.choice_edit.get('boundingBox'), '.value', 'mousedown');
27+ simulate(this.choice_edit.get('boundingBox'), '.value', 'click');
28 Assert.isNull(
29 edit_icon.get('src').match(/\/spinner$/),
30 "The edit icon is displaying a spinner after opening the choice list.");

Subscribers

People subscribed via source and target branches

to status/vote changes: