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

Commit 38fd896

Browse files
gkalpakpetebacondarwin
authored andcommitted
refactor(test/e2e): restore consistency across tests (just because)
1 parent f96d553 commit 38fd896

File tree

14 files changed

+69
-62
lines changed

14 files changed

+69
-62
lines changed
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<!DOCTYPE html>
22
<html ng-app="test">
3-
<div ng-controller="TestCtrl">
4-
<p>{{text}}</p>
5-
</div>
3+
<body>
4+
<div ng-controller="TestController">
5+
<p>{{text}}</p>
6+
</div>
67

7-
<script src="angular.js"></script>
8-
<script src="angular.js"></script>
9-
<script src="script.js"></script>
8+
<script src="angular.js"></script>
9+
<script src="angular.js"></script>
10+
<script src="script.js"></script>
11+
</body>
1012
</html>
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
angular.module("test", []).
2-
controller("TestCtrl", function($scope) {
3-
$scope.text = "Hello, world!";
1+
angular.
2+
module('test', []).
3+
controller('TestController', function($scope) {
4+
$scope.text = 'Hello, world!';
45
});

test/e2e/fixtures/loader/index.html

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
<!DOCTYPE html>
22
<html ng-app="test">
3-
<div ng-controller="TestCtrl">
4-
<p>{{text}}</p>
5-
</div>
3+
<body>
4+
<div ng-controller="TestController">
5+
<p>{{text}}</p>
6+
</div>
67

7-
<script src="angular-loader.js"></script>
8-
<script src="angular-touch.js"></script>
9-
<script src="angular-sanitize.js"></script>
10-
<script src="angular-route.js"></script>
11-
<script src="angular-resource.js"></script>
12-
<script src="angular-parse-ext.js"></script>
13-
<script src="angular-messages.js"></script>
14-
<script src="angular-message-format.js"></script>
15-
<script src="angular-cookies.js"></script>
16-
<script src="angular-aria.js"></script>
17-
<script src="angular-animate.js"></script>
18-
<script src="angular.js"></script>
19-
<script src="script.js"></script>
8+
<!-- Load modules before `angular.js` -->
9+
<script src="angular-loader.js"></script>
10+
<script src="angular-touch.js"></script>
11+
<script src="angular-sanitize.js"></script>
12+
<script src="angular-route.js"></script>
13+
<script src="angular-resource.js"></script>
14+
<script src="angular-parse-ext.js"></script>
15+
<script src="angular-messages.js"></script>
16+
<script src="angular-message-format.js"></script>
17+
<script src="angular-cookies.js"></script>
18+
<script src="angular-aria.js"></script>
19+
<script src="angular-animate.js"></script>
20+
<script src="angular.js"></script>
21+
<script src="script.js"></script>
22+
</body>
2023
</html>

test/e2e/fixtures/loader/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ angular.
1111
'ngAria',
1212
'ngAnimate'
1313
]).
14-
controller('TestCtrl', function TestCtrl($scope) {
14+
controller('TestController', function($scope) {
1515
$scope.text = 'Hello, world!';
1616
});

test/e2e/fixtures/ngJq/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
window[''] = window.jQuery;
1111
</script>
1212
<script src="angular.js"></script>
13-
<script type="text/javascript" src="script.js"></script>
13+
<script src="script.js"></script>
1414
</body>
1515
</html>

test/e2e/fixtures/ngJq/script.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
angular.module('test', [])
2-
.run(function($rootScope) {
1+
angular.
2+
module('test', []).
3+
run(function($rootScope) {
34
$rootScope.jqueryVersion = window.angular.element().jquery || 'jqLite';
45
});
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<!DOCTYPE html>
22
<html ng-app="test" ng-jq="jQuery_2_1_0">
33
<body>
4-
{{jqueryVersion}}
4+
{{jqueryVersion}}
55

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>
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 src="script.js"></script>
13+
</body>
1414
</html>
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
angular.module('test', [])
2-
.run(function($rootScope) {
1+
angular.
2+
module('test', []).
3+
run(function($rootScope) {
34
$rootScope.jqueryVersion = window.angular.element().jquery || 'jqLite';
45
});

test/e2e/fixtures/sample/index.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<!DOCTYPE html>
22
<html ng-app="test">
3-
<div ng-controller="TestCtrl">
4-
<p>{{text}}</p>
5-
</div>
3+
<body>
4+
<div ng-controller="TestController">
5+
<p>{{text}}</p>
6+
</div>
67

7-
<script src="angular.js"></script>
8-
<script src="script.js"></script>
8+
<script src="angular.js"></script>
9+
<script src="script.js"></script>
10+
</body>
911
</html>

test/e2e/fixtures/sample/script.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
angular.module("test", []).
2-
controller("TestCtrl", function($scope) {
3-
$scope.text = "Hello, world!";
1+
angular.
2+
module('test', []).
3+
controller('TestController', function($scope) {
4+
$scope.text = 'Hello, world!';
45
});
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
describe('App where angular is loaded more than once', function() {
22
beforeEach(function() {
3-
loadFixture("angular-already-loaded").andWaitForAngular();
3+
loadFixture('angular-already-loaded').andWaitForAngular();
44
});
55

66
it('should have the interpolated text', function() {
7-
expect(element(by.binding('text')).getText())
8-
.toBe('Hello, world!');
7+
expect(element(by.binding('text')).getText()).toBe('Hello, world!');
98
});
109
});

test/e2e/tests/loaderSpec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
describe('loader', function() {
1+
describe('angular-loader', function() {
22
beforeEach(function() {
3-
loadFixture("loader").andWaitForAngular();
3+
loadFixture('loader').andWaitForAngular();
44
});
55

66
it('should not be broken by loading the modules before core', function() {

test/e2e/tests/ngJqSpec.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
describe('Customizing the jqlite / jquery version', function() {
2-
3-
it('should be able to force jqlite', function() {
4-
loadFixture("ngJq").andWaitForAngular();
1+
describe('Customizing the jqLite / jQuery version', function() {
2+
it('should be able to force jqLite', function() {
3+
loadFixture('ngJq').andWaitForAngular();
54
expect(element(by.binding('jqueryVersion')).getText()).toBe('jqLite');
65
});
76

87
it('should be able to use a specific version jQuery', function() {
9-
loadFixture("ngJqJquery").andWaitForAngular();
8+
loadFixture('ngJqJquery').andWaitForAngular();
109
expect(element(by.binding('jqueryVersion')).getText()).toBe('2.1.0');
1110
});
1211
});

test/e2e/tests/sampleSpec.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
// Sample E2E test:
2-
//
32
describe('Sample', function() {
43
beforeEach(function() {
5-
loadFixture("sample").andWaitForAngular();
4+
loadFixture('sample').andWaitForAngular();
65
});
76

87
it('should have the interpolated text', function() {
9-
expect(element(by.binding('text')).getText())
10-
.toBe('Hello, world!');
8+
expect(element(by.binding('text')).getText()).toBe('Hello, world!');
119
});
1210
});

0 commit comments

Comments
 (0)