Skip to content

Commit 3940edc

Browse files
committed
test(*): ensure console log doesn't break the app in IE9
When Angular is loaded more than once (by including the script multiple times), a warning is logged in the console. IE9 only makes the console available when the dev tools are open, so before this fix, the browser would throw an error Note that Protractor doesn't actually support IE9.
1 parent 7c60e19 commit 3940edc

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html ng-app="test">
3+
<div ng-controller="TestCtrl">
4+
<p>{{text}}</p>
5+
</div>
6+
7+
<script src="angular.js"></script>
8+
<script src="angular.js"></script>
9+
<script src="script.js"></script>
10+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
angular.module("test", []).
2+
controller("TestCtrl", function($scope) {
3+
$scope.text = "Hello, world!";
4+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
describe('App where angular is loaded more than once', function() {
2+
beforeEach(function() {
3+
loadFixture("angular-already-loaded").andWaitForAngular();
4+
});
5+
6+
it('should have the interpolated text', function() {
7+
expect(element(by.binding('text')).getText())
8+
.toBe('Hello, world!');
9+
});
10+
});

0 commit comments

Comments
 (0)