1
0
mirror of https://github.com/danbee/mpd-client synced 2025-03-04 08:39:09 +00:00
mpd-client/spec/javascripts/controllers/transport.controller.spec.js
2014-04-08 16:43:02 +01:00

33 lines
811 B
JavaScript

describe('transport controller', function() {
var TransportController, scope
beforeEach(module('mpdClient'))
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new()
TransportController = $controller('transport', { $scope: scope, api: mockApi })
}))
it('gets the status from the API', function () {
expect(scope.status.volume).toBe(100)
})
it('gets the playing status', function () {
expect(scope.playing()).toBe(true)
status = scope.status
status.state = 'stop'
scope.updateStatus(status)
expect(scope.playing()).toBe(false)
})
it('gets the stopped status', function () {
expect(scope.stopped()).toBe(false)
})
it('reports the correct marker position', function () {
expect(scope.markerPosition()).toBe(50)
})
});