Created
July 27, 2012 14:47
-
-
Save danscotton/3188452 to your computer and use it in GitHub Desktop.
empFacade tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define('http://emp.bbci.co.uk/emp/clear/embed.js', function() { | |
| var api = { | |
| setWidth: sinon.spy(), | |
| setHeight: sinon.spy(), | |
| setDomId: sinon.spy(), | |
| setPlaylist: sinon.spy(), | |
| write: sinon.spy(), | |
| setMediator: function() {}, | |
| set: function() {} | |
| }; | |
| return { | |
| Player: function() { | |
| return api; | |
| }, | |
| spies: api | |
| }; | |
| }); | |
| define([ | |
| 'module/bootstrap', | |
| 'module/media/empFacade', | |
| 'http://emp.bbci.co.uk/emp/clear/embed.js' | |
| ], function( | |
| news, | |
| EmpFacade, | |
| emp | |
| ) { | |
| module('EmpFacade', { | |
| setup: function() { | |
| this.options = { | |
| playlist: 'playlists.bbc.co.uk', | |
| id: 'video-12345', | |
| width: 160, | |
| height: 90 | |
| }; | |
| } | |
| }); | |
| test('create an Emp.Player object and sets it up correctly', function() { | |
| var empFacade = new EmpFacade(this.options); | |
| ok(emp.spies.setWidth.calledWith(this.options.width)); | |
| ok(emp.spies.setHeight.calledWith(this.options.height)); | |
| ok(emp.spies.setDomId.calledWith(this.options.id)); | |
| ok(emp.spies.setPlaylist.calledWith(this.options.playlist)); | |
| ok(emp.spies.write.called); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment