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.
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 setUpWorkItemEx panders 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 setUpWorkItemEx panders. 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). expanders Tests" started. 7581177" started. xpanders test" started. 7581177" completed. temExpanders: failed. slide_out' of undefined xpanders test" completed. expanders Tests" completed.
TestRunner: Test suite "lp.workitems.
TestRunner: Testing began at Fri May 25 2012 15:53:01 GMT+0100 (BST).
TestRunner: Test suite "yuitests133795
TestRunner: Test case "setUpWorkItemE
TestRunner: Test suite "yuitests133795
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_setUpWorkI
Unexpected error: Cannot call method 'reversible_
TestRunner: Test case "setUpWorkItemE
Passed:0 Failed:1 Total:1 (0 ignored)
TestRunner: Test suite "lp.workitems.
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.