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

Commit b9d3964

Browse files
committed
test(bootstrap): ensure console log doesn't break the app
When angular is loaded more than once (by including multiple script files), 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
1 parent 22478d2 commit b9d3964

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed
Lines changed: 10 additions & 0 deletions
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>
Lines changed: 4 additions & 0 deletions
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+
});
Lines changed: 10 additions & 0 deletions
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)