
However, saving track's position is broken. Some are still there because of problems I don't know how to solve, e.g. circular dependency between notifications and player. Uses the queue controller for the sidebar queue. Moves loadTrackPosition to the main controller.
30 lines
792 B
JavaScript
30 lines
792 B
JavaScript
describe("Queue controller", function() {
|
|
'use strict';
|
|
|
|
var player, scope;
|
|
|
|
beforeEach(function() {
|
|
module('jamstash.queue.ctrl');
|
|
|
|
inject(function ($controller, $rootScope, _player_) {
|
|
scope = $rootScope.$new();
|
|
player = _player_;
|
|
|
|
// Mock the functions of the services
|
|
spyOn(player, "playSong").and.stub();
|
|
|
|
$controller('PlayerCtrl', {
|
|
$scope: scope,
|
|
player: player
|
|
});
|
|
});
|
|
|
|
it("When I call playSong, it calls playSong in the player service", function() {
|
|
var fakeSong = {"id": 3174};
|
|
|
|
scope.playSong(true, fakeSong);
|
|
|
|
expect(player.playSong).toHaveBeenCalledWith(true, fakeSong);
|
|
});
|
|
});
|
|
});
|