Skip to content

Commit 00375b3

Browse files
committed
Merge pull request #3788 from amyboyd/gridObjectTestUtils
Add gridObjectTestUtils.
2 parents af2ef34 + 38713ba commit 00375b3

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/e2e/gridObjectTestUtils.spec.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/* globals element, by */
2+
3+
var gridTestUtils = require('./gridTestUtils.spec.js');
4+
5+
function getProxyToRealMethod(gridId, method) {
6+
return function() {
7+
var callArgs = [gridId].concat(Array.prototype.slice.call(arguments));
8+
gridTestUtils[method].apply(gridTestUtils, callArgs);
9+
};
10+
}
11+
12+
/**
13+
* @ngdoc overview
14+
* @name ui.grid.e2eTestLibrary
15+
* @description
16+
* End to end test functions.
17+
*/
18+
19+
/**
20+
* @ngdoc service
21+
* @name ui.grid.e2eTestLibrary.api:gridTestObject
22+
* @description
23+
* End to end test functions.
24+
*/
25+
module.exports = function(gridId) {
26+
for (var method in gridTestUtils) {
27+
this[method] = getProxyToRealMethod(gridId, method);
28+
}
29+
};
30+

0 commit comments

Comments
 (0)