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

Commit 3fd4874

Browse files
Narretzpetebacondarwin
authored andcommitted
test(ngJq): add e2e tests
Closes #11182
1 parent 17f02d5 commit 3fd4874

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-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

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

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)