Code review comment for lp:~dooferlad/launchpad/upcomingwork-expand-all

Revision history for this message
James Tunnicliffe (dooferlad) wrote :

Hi,

I am not sure how best to proceed with testing. I have got a test JS and HTML set up with a bit of example layout in the HTML for the JS to search through. It is my intention to run setUpWorkItemExpanders and maybe mock Y.lp.app.widgets.expander so I can avoid loading it and test that expanders array looks correct after it has run.

Other tests would start using the same template but simulate clicks to test each on click function is run when expected.

So, to do this I would need to pass in Y.lp.app.widgets.expander as a parameter to setUpWorkItemExpanders. I wasn't going to bother testing the parameters to Expander(expander_icon, widget_body) since I think the contents of expanders will demonstrate that we have extracted the data needed from the DOM.

One odd thing is that the JS console at the moment (in Chrome) contains:

TestRunner: Testing began at Fri May 25 2012 15:53:01 GMT+0100 (BST).
TestRunner: Test suite "lp.workitems.expanders Tests" started.
TestRunner: Testing began at Fri May 25 2012 15:53:01 GMT+0100 (BST).
TestRunner: Test suite "yuitests1337957581177" started.
TestRunner: Test case "setUpWorkItemExpanders test" started.
TestRunner: Test suite "yuitests1337957581177" completed.
Passed:0 Failed:0 Total:0 (0 ignored)
TestRunner: Testing completed at Fri May 25 2012 15:53:01 GMT+0100 (BST).
Passed:0 Failed:0 Total:0 (0 ignored)
TestRunner: test_setUpWorkItemExpanders: failed.
Unexpected error: Cannot call method 'reversible_slide_out' of undefined
TestRunner: Test case "setUpWorkItemExpanders test" completed.
Passed:0 Failed:1 Total:1 (0 ignored)
TestRunner: Test suite "lp.workitems.expanders Tests" completed.
Passed:0 Failed:1 Total:1 (0 ignored)
TestRunner: Testing completed at Fri May 25 2012 15:53:03 GMT+0100 (BST).
Passed:0 Failed:1 Total:1 (0 ignored)

I don't know where the Test suite "yuitests<random number>" came from. Only they are visible in the browser based console. I have pushed my branch so you can have a look at it, if you want to.

« Back to merge proposal