aboutsummaryrefslogtreecommitdiffstats
path: root/test/BrowserSpecs.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/BrowserSpecs.js')
-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]);
+ });
+ });
});