<commit_before>describe('PlaylistControllerTests', function(){
	var S3Service, schedulerService, PlaylistController, $scope, $rootScope, $q, $interval, uuid, BXFGeneratorService, mediaAssetsService, currentVideoStatusService, mediaProcessingService;
	var mockFile = {file:[{"name":"file.bin", "size":1024, "type":"application/binary"}]};
	var mockVideo = new Blob([""], { type: 'video/mp4', size: 1024, duration: 60});
	
	beforeEach(angular.mock.module('adminUI'));

    beforeEach(inject(function($injector, _$rootScope_, $controller, _$q_, _$interval_, _S3Service_, _BXFGeneratorService_, _mediaAssetsService_, _schedulerService_, _uuid_, _currentVideoStatusService_) {
		$rootScope = _$rootScope_;
		$scope = $rootScope;
        createS3Service = function($rootScope) {
            return $injector.get('S3Service');
        };
        createSchedulerService = function($rootScope) {
            return $injector.get('schedulerService');
		};
		createBXFGeneratorService = function($rootScope) {
			return $injector.get('BXFGeneratorService');
		};
		createMediaAssetsService = function($rootScope) {
			return $injector.get('mediaAssetsService');
		};
		createCurrentVideoStatusService = function($rootScope) {
			return $injector.get('currentVideoStatusService');
		};
		creatMediaProcessingService = function($rootScope) {
			return $injector.get("mediaProcessingService");
		};

       $q = _$q_;
	   uuid = _uuid_;
	   $interval = _$interval_;
       S3Service = createS3Service($scope);
	   schedulerService = createSchedulerService($scope);
	   mediaAssetsService = createMediaAssetsService($scope);
	   BXFGeneratorService = createBXFGeneratorService($scope);
	   currentVideoStatusService = createCurrentVideoStatusService($scope);
	   mediaProcessingService = creatMediaProcessingService($scope);
	
       createPlaylistController = function() {
           return $controller('PlaylistController', {
               '$scope': $scope,
               '$rootScope': $rootScope,
               'S3Service': S3Service,
			   '$q': $q,
			   '$interval': $interval,
               'uuid': uuid,
			   'schedulerService': schedulerService,
			   'mediaAssetsService': mediaAssetsService,
			   'BXFGeneratorService': BXFGeneratorService,
			   'currentVideoStatusService': currentVideoStatusService,
			   'mediaProcessingService': mediaProcessingService
           });
       }
    }));
    
    describe('initial load tests', function() {
        it('should correctly bind $scope variables', function() {
            // Bind $scope's variables to different things to ensure bindings are correct
            $scope.videos = 123;
            $scope.uploadProgress = 123;
            $scope.fileDuration = 123;
            $scope.fileThumbnail = 123;
            $scope.startTime = 11122223333;
            $scope.videoLength = 123;

            // Create the controller, which binds $scope's variables
            PlaylistController = createPlaylistController($scope, $rootScope, S3Service, BXFGeneratorService, $q, $interval, uuid, schedulerService, currentVideoStatusService, mediaAssetsService, mediaProcessingService);
            expect($scope.videos).toEqual(schedulerService.videos);
            expect($scope.uploadProgress).toBe(0);
            expect($scope.fileDuration).toBe("");
            expect($scope.fileThumbnail).toBeNull();
            expect($scope.startTime).toBe("");
            expect($scope.videoLength).toBe(0);
        });
    });
	
    describe('resetForm() tests', function() {
        it('should correctly reset the form', function() {
            // Bind $scope's variables to different things to ensure bindings are correct
            $scope.title = 123;
            $scope.category = 123;
            $scope.order = 123;
            $scope.uploadProgress = 123;
            $scope.startTime = 11122223333;
            $scope.videoStartTime = 1123;
            $scope.file = 123;

            PlaylistController = createPlaylistController($scope, $rootScope, S3Service, BXFGeneratorService, $q, $interval, uuid, schedulerService, currentVideoStatusService, mediaAssetsService, mediaProcessingService);<commit_msg>bring coverage back up<commit_after>describe('PlaylistControllerTests', function(){
	var S3Service, schedulerService, PlaylistController, $scope, $rootScope, $q, $interval, uuid, BXFGeneratorService, mediaAssetsService, currentVideoStatusService, mediaProcessingService;
	var mockFile = {file:[{"name":"file.bin", "size":1024, "type":"application/binary"}]};
	var mockVideo = new Blob([""], { type: 'video/mp4', size: 1024, duration: 60});
	
	beforeEach(angular.mock.module('adminUI'));

    beforeEach(inject(function($injector, _$rootScope_, $controller, _$q_, _$interval_, _S3Service_, _BXFGeneratorService_, _mediaAssetsService_, _schedulerService_, _uuid_, _currentVideoStatusService_) {
		$rootScope = _$rootScope_;
		$scope = $rootScope;
        createS3Service = function($rootScope) {
            return $injector.get('S3Service');
        };
        createSchedulerService = function($rootScope) {
            return $injector.get('schedulerService');
		};
		createBXFGeneratorService = function($rootScope) {
			return $injector.get('BXFGeneratorService');
		};
		createMediaAssetsService = function($rootScope) {
			return $injector.get('mediaAssetsService');
		};
		createCurrentVideoStatusService = function($rootScope) {
			return $injector.get('currentVideoStatusService');
		};
		creatMediaProcessingService = function($rootScope) {
			return $injector.get("mediaProcessingService");
		};

       $q = _$q_;
	   uuid = _uuid_;
	   $interval = _$interval_;
       S3Service = createS3Service($scope);
	   schedulerService = createSchedulerService($scope);
	   mediaAssetsService = createMediaAssetsService($scope);
	   BXFGeneratorService = createBXFGeneratorService($scope);
	   currentVideoStatusService = createCurrentVideoStatusService($scope);
	   mediaProcessingService = creatMediaProcessingService($scope);
	
       createPlaylistController = function() {
           return $controller('PlaylistController', {
               '$scope': $scope,
               '$rootScope': $rootScope,
               'S3Service': S3Service,
			   '$q': $q,
			   '$interval': $interval,
               'uuid': uuid,
			   'schedulerService': schedulerService,
			   'mediaAssetsService': mediaAssetsService,
			   'BXFGeneratorService': BXFGeneratorService,
			   'currentVideoStatusService': currentVideoStatusService,
			   'mediaProcessingService': mediaProcessingService
           });
       }
    }));
    
    describe('initial load tests', function() {
        it('should correctly bind $scope variables', function() {
            // Bind $scope's variables to different things to ensure bindings are correct
            $scope.videos = 123;
            $scope.uploadProgress = 123;
            $scope.fileDuration = 123;
            $scope.fileThumbnail = 123;
            $scope.startTime = 11122223333;
            $scope.videoLength = 123;

            // Create the controller, which binds $scope's variables
            PlaylistController = createPlaylistController($scope, $rootScope, S3Service, BXFGeneratorService, $q, $interval, uuid, schedulerService, currentVideoStatusService, mediaAssetsService, mediaProcessingService);
            expect($scope.videos).toEqual(schedulerService.videos);
            expect($scope.uploadProgress).toBe(0);
            expect($scope.fileDuration).toBe("");
            expect($scope.fileThumbnail).toBeNull();
            expect($scope.startTime).toBe("");
            expect($scope.videoLength).toBe(0);
        });
	});
	
	describe('sortableOptions', function() {
		beforeEach(function() {
            PlaylistController = createPlaylistController($scope, $rootScope, S3Service, BXFGeneratorService, $q, $interval, uuid, schedulerService, currentVideoStatusService, mediaAssetsService, mediaProcessingService);
		});
		it('should correctly set the order of the items', function() {
			schedulerService.videos = [{order: 3}, {order: 5}, {order: 2}, {order: 1}, {order: 4}];
			$scope.sortableOptions.stop();
			var expectedResult = [{order: 1}, {order: 2}, {order: 3}, {order: 4}, {order: 5}];
			expect(schedulerService.videos).toEqual(expectedResult);
			expect($scope.videos).toEqual(expectedResult);
		});
	});
	
    describe('resetForm() tests', function() {
        it('should correctly reset the form', function() {
            // Bind $scope's variables to different things to ensure bindings are correct
            $scope.title = 123;
            $scope.category = 123;
            $scope.order = 123;
            $scope.uploadProgress = 123;
            $scope.startTime = 11122223333;
            $scope.videoStartTime = 1123;
            $scope.file = 123;

            PlaylistController = createPlaylistController($scope, $rootScope, S3Service, BXFGeneratorService, $q, $interval, uuid, schedulerService, currentVideoStatusService, mediaAssetsService, mediaProcessingService);
{'fraction_non_alphanumeric': 0.12180768376637797, 'fraction_numerical': 0.01876526759937819, 'mean_word_length': 3.5535894843276035, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5922767', 'n_tokens_mistral': 2662, 'n_tokens_neox': 2392, 'n_words': 488}