Skip to content

Conversation

amyboyd
Copy link
Contributor

@amyboyd amyboyd commented Jun 16, 2015

Before:

var gridTestUtils = require('lib/gridTestUtils.spec.js');
gridTestUtils.expectHeaderColumnCount('users-table', 6);
gridTestUtils.expectHeaderCellValueMatch('users-table', 0, 'ID');
gridTestUtils.expectHeaderCellValueMatch('users-table', 1, 'Name');
gridTestUtils.expectHeaderCellValueMatch('users-table', 2, 'Email');

After:

var GridObjectTest = require('lib/gridObjectTestUtils.spec.js');
var usersGrid = new GridObjectTest('users-table');
usersGrid.expectHeaderColumnCount(6);
usersGrid.expectHeaderCellValueMatch(0, 'ID');
usersGrid.expectHeaderCellValueMatch(1, 'Name');
usersGrid.expectHeaderCellValueMatch(2, 'Email');

Before:

    var gridTestUtils = require('lib/gridTestUtils.spec.js');
    gridTestUtils.expectHeaderColumnCount('users-table', 6);
    gridTestUtils.expectHeaderCellValueMatch('users-table', 0, 'ID');
    gridTestUtils.expectHeaderCellValueMatch('users-table', 1, 'Name');
    gridTestUtils.expectHeaderCellValueMatch('users-table', 2, 'Email');

After:

    var GridObjectTest = require('lib/gridObjectTestUtils.spec.js');
    var usersGrid = new GridObjectTest('users-table');
    usersGrid.expectHeaderColumnCount(6);
    usersGrid.expectHeaderCellValueMatch(0, 'ID');
    usersGrid.expectHeaderCellValueMatch(1, 'Name');
    usersGrid.expectHeaderCellValueMatch(2, 'Email');
@amyboyd amyboyd closed this Jun 16, 2015
@amyboyd
Copy link
Contributor Author

amyboyd commented Jun 16, 2015

Sorry for closing -- thought there was a bug in this -- it was actually a bug in my real tests!

@amyboyd amyboyd reopened this Jun 16, 2015
amyboyd added a commit to amyboyd/citypantry-3-frontend that referenced this pull request Jun 16, 2015
The changes to ng-grid have been sent to the upstream in these pull requests:

angular-ui/ui-grid#3787
angular-ui/ui-grid#3788
amyboyd added a commit to amyboyd/citypantry-3-frontend that referenced this pull request Jun 16, 2015
The changes to ng-grid have been sent to the upstream in these pull requests:

angular-ui/ui-grid#3787
angular-ui/ui-grid#3788
@PaulL1
Copy link
Contributor

PaulL1 commented Jun 16, 2015

That's really elegant. And it looks like it's backwards compatible? (i.e. we can choose to change the existing tests or not change them?)

PaulL1 added a commit that referenced this pull request Jun 16, 2015
@PaulL1 PaulL1 merged commit 00375b3 into angular-ui:master Jun 16, 2015
@amyboyd
Copy link
Contributor Author

amyboyd commented Jun 16, 2015

@PaulL1 Yep, it's fully backwards compatible. Thanks for the merge. :)

@PaulL1
Copy link
Contributor

PaulL1 commented Jun 16, 2015

Further, I've just updated the 101 and 102 tutorials to use this format. I noted that @c0bra (I think) has needed to use promises to deal with Firefox, and that code relies on the return value from some of the functions. I updated the object to cascade the return value from each function, which seems to allow that code to keep working as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants