aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorIgor Minar2011-07-12 00:44:18 -0700
committerIgor Minar2011-07-13 16:21:08 -0700
commit47efe44a1d8c9a40526a610b5ee31c44288adee0 (patch)
tree26c45bc1fb7f11307e5038a6e45d400bff3d86bd /test
parentc52e749a6eaec80a1229c59d7f938ec729f5ec8c (diff)
downloadangular.js-47efe44a1d8c9a40526a610b5ee31c44288adee0.tar.bz2
fix($browser.addJs): make addJs jQuery compatible
Change addJs implementation to avoid use of jQuery because of issues that affect angular-ie-compat.js. See inlined comment for more info.
Diffstat (limited to 'test')
-rw-r--r--test/BrowserSpecs.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/BrowserSpecs.js b/test/BrowserSpecs.js
index 96839a1c..f87e98f8 100644
--- a/test/BrowserSpecs.js
+++ b/test/BrowserSpecs.js
@@ -505,4 +505,28 @@ describe('browser', function(){
});
});
});
+
+ describe('addJs', function() {
+
+ it('should append a script tag to body', function() {
+ browser.addJs('http://localhost/bar.js');
+ expect(scripts.length).toBe(1);
+ expect(scripts[0].src).toBe('http://localhost/bar.js');
+ expect(scripts[0].id).toBe('');
+ });
+
+
+ it('should append a script with an id to body', function() {
+ browser.addJs('http://localhost/bar.js', 'foo-id');
+ expect(scripts.length).toBe(1);
+ expect(scripts[0].src).toBe('http://localhost/bar.js');
+ expect(scripts[0].id).toBe('foo-id');
+ });
+
+
+ it('should return the appended script element', function() {
+ var script = browser.addJs('http://localhost/bar.js');
+ expect(script).toBe(scripts[0]);
+ });
+ });
});