← Back to team overview

launchpad-dev team mailing list archive

gotchas and progress so far in testing moving to YUI 3.5

 

I've started the process of update our JS unit tests to pass in YUI 3.5.
I've gone through over 60 test modules so far and wanted to share some of
the things to watch out for. If reviewers can help watch for these it'll
help make the transition easier to get to.


- Selectors that are against a node's attributes need to be quoted.
    - Bad:  Y.one('input[id=field.name]')
    - Good: Y.one('input[id="field.name"]')

- Y.Test.ObjectAssert is broken in YUI 3.3 and fixed in YUI 3.5
    We found that this assertion would say pass for undefined, {id: 1}. So
    any tests using this assertion need to be watched.

- Test results changes
    I've updated the testrunner and the output it dumps out because it had
    issues doing a json.dump on the new test results object with the error:
    "Converting circ structure to json"

- YUI 3.5 History module has some state stored in the browser it pulls in.
    There's a new lp.app.testing.helpers module that includes a
    reset_history() method to use in teardowns to make sure we clear any
    History state in between items that hit it. This is mainly buglisting
    code at the moment, but could grow to more.

- _should in tests no longer accepts Error() objects.
    These need to be plain strings. It's checking for a string in
    particular during processing.

Thanks for keeping an eye out and I'll have more official docs on
porting/changes to take advantage of as we get closer to actually using YUI
3.5. For now, step one is 'pass all the tests!'.


-- 

Rick Harding

Launchpad Developer
https://launchpad.net/~rharding
@mitechie