Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit cc0b703

Browse files
committed
test(ngJq): add e2e tests
1 parent f572b64 commit cc0b703

File tree

5 files changed

+48
-0
lines changed

5 files changed

+48
-0
lines changed

test/e2e/fixtures/ngJq/index.html

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html ng-app="test" ng-jq>
3+
<body>
4+
{{jqueryVersion}}
5+
6+
<script src="../../../../bower_components/jquery/dist/jquery.js"></script>
7+
<script src="angular.js"></script>
8+
<script type="text/javascript" src="script.js"></script>
9+
</body>
10+
</html>

test/e2e/fixtures/ngJq/script.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
3+
angular.module('test', [])
4+
.run(function($rootScope) {
5+
$rootScope.jqueryVersion = window.angular.element().jquery || 'jqLite';
6+
});
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html ng-app="test" ng-jq="jQuery_2_1_0">
3+
<body>
4+
{{jqueryVersion}}
5+
6+
<script src="../../../../bower_components/jquery/dist/jquery.js"></script>
7+
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
8+
<script>
9+
var jQuery_2_1_0 = jQuery.noConflict();
10+
</script>
11+
<script src="angular.js"></script>
12+
<script type="text/javascript" src="script.js"></script>
13+
</body>
14+
</html>
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
3+
angular.module('test', [])
4+
.run(function($rootScope) {
5+
$rootScope.jqueryVersion = window.angular.element().jquery || 'jqLite';
6+
});

test/e2e/tests/ngJqSpec.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
describe('Customizing the jqlite / jquery version', function() {
2+
3+
it('should be able to force jqlite', function() {
4+
loadFixture("ngJq").andWaitForAngular();
5+
expect(element(by.binding('jqueryVersion')).getText()).toBe('jqLite');
6+
});
7+
8+
it('should be able to use a specific version jQuery', function() {
9+
loadFixture("ngJqJquery").andWaitForAngular();
10+
expect(element(by.binding('jqueryVersion')).getText()).toBe('2.1.0');
11+
});
12+
});

0 commit comments

Comments
 (0)