http://git-wip-us.apache.org/repos/asf/aurora/blob/96c834a2/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/lib/angular/version.txt ---------------------------------------------------------------------- diff --git a/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/lib/angular/version.txt b/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/lib/angular/version.txt deleted file mode 100644 index 8b13789..0000000 --- a/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/lib/angular/version.txt +++ /dev/null @@ -1 +0,0 @@ -
http://git-wip-us.apache.org/repos/asf/aurora/blob/96c834a2/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/ColumnSpec.js ---------------------------------------------------------------------- diff --git a/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/ColumnSpec.js b/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/ColumnSpec.js deleted file mode 100644 index 7b92569..0000000 --- a/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/ColumnSpec.js +++ /dev/null @@ -1,27 +0,0 @@ -describe('Column Module', function () { - beforeEach(module('smartTable.column', function ($provide) { - $provide.constant('DefaultColumnConfiguration', {defaultValue: 'default', value: 'defaultValue'}); - $provide.provider('Column', ColumnProvider); - })); - - - describe('Column factory', function () { - it('should always return an instance of Column', inject(function (Column) { - expect(typeof Column()).toBe('object'); - expect(Column() instanceof Column).toBe(true); - expect(typeof new Column()).toBe('object'); - expect(new Column() instanceof Column).toBe(true); - })); - - it('should overwrite default parameters if provided in config', inject(function (Column) { - var column = new Column(); - expect(column.defaultValue).toEqual('default'); - expect(column.value).toEqual('defaultValue'); - - column = new Column({value: 'value', otherValue: 'otherValue'}); - expect(column.defaultValue).toEqual('default'); - expect(column.value).toEqual('value'); - expect(column.otherValue).toEqual('otherValue'); - })); - }); -}); http://git-wip-us.apache.org/repos/asf/aurora/blob/96c834a2/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/TableSpec.js ---------------------------------------------------------------------- diff --git a/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/TableSpec.js b/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/TableSpec.js deleted file mode 100644 index 7a1384e..0000000 --- a/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/TableSpec.js +++ /dev/null @@ -1,641 +0,0 @@ -describe('Table module', function () { - - var - scope, - Column, - DefaultConfig, - filter, - ctrl, - defaultDisplayedCollection = [ - {prop: 'defaultValue'} - ], - ctrlMock = { - pipe: function () { - return defaultDisplayedCollection; - } - }; - - beforeEach(module('smartTable.table', function ($provide) { - $provide.constant('DefaultTableConfiguration', {defaultValue: 'defaultValue', value: 'defaultValue'}); - })); - - describe('Table Controller', function () { - - beforeEach(inject(function ($controller, $rootScope, $filter, $injector) { - scope = $rootScope.$new(); - Column = $injector.get('Column'); - DefaultConfig = $injector.get('DefaultTableConfiguration'); - filter = $filter; - ctrl = $controller('TableCtrl', {$scope: scope, Column: Column, DefaultTableConfig: DefaultConfig, $filter: filter - }); - })); - - it('should init the config', function () { - - expect(angular.isArray(scope.columns)).toBe(true); - expect(angular.isArray(scope.displayedCollection)).toBe(true); - expect(angular.isArray(scope.dataCollection)).toBe(true); - - ctrl.setGlobalConfig({value: 'overwritten'}); - expect(scope.defaultValue).toEqual('defaultValue'); - expect(scope.value).toEqual('overwritten'); - }); - - it('should set and override the config', function () { - ctrl.setGlobalConfig({value: 'overwritten'}); - expect(scope.defaultValue).toEqual('defaultValue'); - expect(scope.value).toEqual('overwritten'); - }); - - describe('change page', function () { - - beforeEach(function () { - var changePage = ctrl.changePage; - ctrl = ctrlMock; - ctrl.changePage = changePage; - }); - - it('should change the page and refresh the displayed items', function () { - spyOn(ctrlMock, 'pipe').andCallThrough(); - scope.currentPage = 1; - ctrl.changePage({page: 2}); - expect(scope.currentPage).toEqual(2); - expect(ctrlMock.pipe).toHaveBeenCalledWith(scope.dataCollection); - expect(scope.displayedCollection).toBe(defaultDisplayedCollection); - }); - - it('should not change the page if provided page parameter is not correct', function () { - scope.currentPage = 3; - spyOn(ctrlMock, 'pipe').andCallThrough(); - ctrl.changePage('whatever'); - expect(scope.currentPage).toEqual(3); - expect(ctrlMock.pipe).not.toHaveBeenCalled(); - }); - - it('should emit an event', inject(function ($rootScope) { - scope.currentPage = 3; - var eventHandler = { - listener: function (event, args) { - expect(args.oldValue).toEqual(3); - expect(args.newValue).toEqual(1); - } - }; - spyOn(eventHandler, 'listener'); - $rootScope.$on('changePage', eventHandler.listener); - ctrl.changePage({page: 1}); - expect(eventHandler.listener).toHaveBeenCalled(); - })); - }); - - describe('Column API', function () { - - beforeEach(function () { - scope.columns = [new Column({id: 0}), new Column({id: 1})]; - }); - - it('should add column at proper index or put it at the end', function () { - - expect(scope.columns.length).toEqual(2); - //insert at a given index - ctrl.insertColumn({id: 3}, 1); - expect(scope.columns.length).toBe(3); - expect(scope.columns[1].id).toBe(3); - }); - - it('should add Column at the end', function () { - expect(scope.columns.length).toEqual(2); - - ctrl.insertColumn({id: 666}, -1); - expect(scope.columns.length).toBe(3); - expect(scope.columns[2].id).toBe(666); - ctrl.insertColumn({id: 99}, 99); - expect(scope.columns.length).toBe(4); - expect(scope.columns[3].id).toBe(99); - }); - - it('should remove column at proper index or do nothing', function () { - - expect(scope.columns.length).toEqual(2); - - ctrl.removeColumn(0); - expect(scope.columns.length).toBe(1); - expect(scope.columns[0].id).toBe(1); - - ctrl.removeColumn(666); - expect(scope.columns.length).toBe(1); - ctrl.removeColumn(-1); - expect(scope.columns.length).toBe(1); - }); - - describe('move column', function () { - - beforeEach(function () { - //insert few columns - scope.columns = []; - - ctrl.insertColumn({id: 0}); - ctrl.insertColumn({id: 1}); - ctrl.insertColumn({id: 2}); - ctrl.insertColumn({id: 3}); - ctrl.insertColumn({id: 4}); - }); - - it('should move a column from a lower index to an higher one', function () { - ctrl.moveColumn(0, 3); - expect(scope.columns[0].id).toBe(1); - expect(scope.columns[3].id).toBe(0); - }); - - it('should move a column from a higher index to a lower one', function () { - ctrl.moveColumn(4, 1); - expect(scope.columns[4].id).toBe(3); - expect(scope.columns[1].id).toBe(4) - }); - - it('should not move any column', function () { - ctrl.moveColumn(-1, 3); - expect(scope.columns[3].id).toBe(3); - ctrl.moveColumn(3, 666); - expect(scope.columns[3].id).toBe(3); - }); - }); - - describe('clear columns', function () { - - beforeEach(function () { - //insert few columns - scope.columns = []; - - ctrl.insertColumn({id: 0}); - ctrl.insertColumn({id: 1}); - ctrl.insertColumn({id: 2}); - ctrl.insertColumn({id: 3}); - ctrl.insertColumn({id: 4}); - }); - - it('should remove all columns', function () { - expect(scope.columns.length).toBe(5); - ctrl.clearColumns(); - expect(scope.columns.length).toBe(0); - }); - - it('should have columns when adding after clear', function () { - ctrl.clearColumns(); - ctrl.insertColumn({id: 7}); - ctrl.insertColumn({id: 8}); - ctrl.insertColumn({id: 9}); - expect(scope.columns[0].id).toBe(7); - expect(scope.columns[1].id).toBe(8); - expect(scope.columns[2].id).toBe(9); - }); - - }); - }); - - describe('Row API', function () { - var refArray = [ - {id: 0}, - {id: 1}, - {id: 2} - ]; - beforeEach(function () { - scope.displayedCollection = scope.dataCollection = [ - {id: 0}, - {id: 1}, - {id: 2} - ]; - }); - - describe('Select dataRows', function () { - - describe('in single selection Mode', function () { - - beforeEach(function () { - scope.selectionMode = 'single'; - scope.displayedCollection = scope.dataCollection = [ - {id: 0, secondProperty: true, thirdProperty: 1}, - {id: 1, secondProperty: true, thirdProperty: 2}, - {id: 2, secondProperty: true, thirdProperty: 1} - ]; - }); - - it('should only set isSelected=true to only one item at the time', function () { - ctrl.toggleSelection(scope.displayedCollection[0]); - expect(scope.dataCollection[0].isSelected).toBe(true); - expect(scope.dataCollection[1].isSelected).not.toBe(true); - expect(scope.dataCollection[2].isSelected).not.toBe(true); - - ctrl.toggleSelection(scope.displayedCollection[1]); - expect(scope.dataCollection[0].isSelected).not.toBe(true); - expect(scope.dataCollection[1].isSelected).toBe(true); - expect(scope.dataCollection[2].isSelected).not.toBe(true); - }); - - it('should emit event when being selected', inject(function ($rootScope) { - var eventHanlder = { - listener: function (event, args) { - expect(args.item).toEqual(scope.displayedCollection[0]); - expect(args.item.isSelected).toBe(true); - } - }; - spyOn(eventHanlder, 'listener').andCallThrough(); - $rootScope.$on('selectionChange', eventHanlder.listener); - ctrl.toggleSelection(scope.displayedCollection[0]); - expect(eventHanlder.listener).toHaveBeenCalled(); - })); - - it('should emit event when being unselected', inject(function ($rootScope) { - ctrl.toggleSelection(scope.displayedCollection[0]); - expect(scope.displayedCollection[0].isSelected).toBe(true); - - var callCounter = 0; - var eventHanlder = { - listener: function (event, args) { - - //first time call : unselect the previously selected - if (callCounter === 0) { - expect(args.item).toEqual(scope.displayedCollection[0]); - expect(args.item.isSelected).toBe(false); - callCounter++; - } else { - expect(args.item).toEqual(scope.displayedCollection[1]); - expect(args.item.isSelected).toBe(true); - } - } - }; - spyOn(eventHanlder, 'listener').andCallThrough(); - $rootScope.$on('selectionChange', eventHanlder.listener); - ctrl.toggleSelection(scope.displayedCollection[1]); - expect(eventHanlder.listener.callCount).toBe(2); - })); - - it('should unselect', function () { - ctrl.toggleSelection(scope.displayedCollection[0]); - expect(scope.dataCollection[0].isSelected).toBe(true); - ctrl.toggleSelection(scope.displayedCollection[0]); - expect(scope.dataCollection[0].isSelected).not.toBe(true); - }); - - it('should not select any row when calling toggleSelectAll', function () { - ctrl.toggleSelectionAll(true); - expect(scope.dataCollection[0].isSelected).not.toBe(true); - expect(scope.dataCollection[1].isSelected).not.toBe(true); - expect(scope.dataCollection[2].isSelected).not.toBe(true); - }); - }); - - describe('selection in selection mode multiple', function () { - - beforeEach(function () { - scope.selectionMode = 'multiple'; - - scope.displayedCollection = scope.dataCollection = [ - {id: 0, secondProperty: true, thirdProperty: 1}, - {id: 1, secondProperty: true, thirdProperty: 2}, - {id: 2, secondProperty: true, thirdProperty: 1} - ]; - }); - - it('should set isSelected=true to any row', function () { - ctrl.toggleSelection(scope.displayedCollection[0]); - expect(scope.dataCollection[0].isSelected).toBe(true); - expect(scope.dataCollection[1].isSelected).not.toBe(true); - expect(scope.dataCollection[2].isSelected).not.toBe(true); - - ctrl.toggleSelection(scope.displayedCollection[1]); - expect(scope.dataCollection[0].isSelected).toBe(true); - expect(scope.dataCollection[1].isSelected).toBe(true); - expect(scope.dataCollection[2].isSelected).not.toBe(true); - }); - - it('should unselect any row', function () { - ctrl.toggleSelection(scope.displayedCollection[0]); - expect(scope.dataCollection[0].isSelected).toBe(true); - expect(scope.dataCollection[1].isSelected).not.toBe(true); - expect(scope.dataCollection[2].isSelected).not.toBe(true); - - ctrl.toggleSelection(scope.displayedCollection[0]); - expect(scope.dataCollection[0].isSelected).not.toBe(true); - expect(scope.dataCollection[1].isSelected).not.toBe(true); - expect(scope.dataCollection[2].isSelected).not.toBe(true); - }); - - it('should select all the displayed row when calling toggleSelectAll with true', function () { - ctrl.toggleSelectionAll(true); - expect(scope.displayedCollection[0].isSelected).toBe(true); - expect(scope.displayedCollection[1].isSelected).toBe(true); - expect(scope.displayedCollection[2].isSelected).toBe(true); - - scope.displayedCollection[0].isSelected = false; - ctrl.toggleSelectionAll(true); - expect(scope.displayedCollection[0].isSelected).toBe(true); - expect(scope.displayedCollection[1].isSelected).toBe(true); - expect(scope.displayedCollection[2].isSelected).toBe(true); - }); - - it('should unselect all the displayed row when calling toggleSelectAll with anything but true', function () { - scope.displayedCollection[0].isSelected = true; - scope.displayedCollection[1].isSelected = true; - ctrl.toggleSelectionAll('whatever'); - expect(scope.displayedCollection[0].isSelected).not.toBe(true); - expect(scope.displayedCollection[1].isSelected).not.toBe(true); - expect(scope.displayedCollection[2].isSelected).not.toBe(true); - - scope.displayedCollection[0].isSelected = true; - scope.displayedCollection[1].isSelected = true; - ctrl.toggleSelectionAll(false); - expect(scope.displayedCollection[0].isSelected).not.toBe(true); - expect(scope.displayedCollection[1].isSelected).not.toBe(true); - expect(scope.displayedCollection[2].isSelected).not.toBe(true); - }); - - it('should always emit an event', inject(function ($rootScope) { - var eventHanlder = { - listener: function (event, args) { - expect(args.item).toEqual(scope.displayedCollection[0]); - expect(args.item.isSelected).toEqual(scope.displayedCollection[0].isSelected); - } - }; - spyOn(eventHanlder, 'listener').andCallThrough(); - $rootScope.$on('selectionChange', eventHanlder.listener); - ctrl.toggleSelection(scope.displayedCollection[0]); - expect(eventHanlder.listener).toHaveBeenCalled(); - ctrl.toggleSelection(scope.displayedCollection[0]); - expect(eventHanlder.listener).toHaveBeenCalled(); - })); - }); - }); - - it('should delete a row from displayed collection and from data collection', function () { - - ctrl.removeDataRow(0); - expect(scope.displayedCollection.length).toBe(2); - expect(scope.dataCollection.length).toBe(2); - expect(scope.displayedCollection).toEqual([ - {id: 1}, - {id: 2} - ]); - expect(scope.dataCollection).toEqual([ - {id: 1}, - {id: 2} - ]); - }); - - it('should not remove any dataRow as the index is wrong', function () { - ctrl.removeDataRow(-1); - expect(scope.displayedCollection.length).toBe(3); - expect(scope.dataCollection.length).toBe(3); - ctrl.removeDataRow(5); - expect(scope.displayedCollection.length).toBe(3); - expect(scope.dataCollection.length).toBe(3); - ctrl.removeDataRow('whatever'); - expect(scope.displayedCollection.length).toBe(3); - expect(scope.dataCollection.length).toBe(3); - }); - - it('should move a row from a higher valid index to a lower valid index in the displayed Collection', function () { - ctrl.moveDataRow(2, 0); - expect(scope.displayedCollection.length).toBe(3); - expect(scope.displayedCollection[0].id).toBe(2); - expect(scope.displayedCollection[2].id).toBe(1); - }); - - it('should move a row from a lower valid index to a higher valid index in the displayed Collection', function () { - ctrl.moveDataRow(0, 1); - expect(scope.displayedCollection.length).toBe(3); - expect(scope.displayedCollection[1].id).toBe(0); - expect(scope.displayedCollection[0].id).toBe(1); - }); - - it('should not move any row with invalid index', function () { - ctrl.moveDataRow(-1, 1); - expect(scope.displayedCollection.length).toBe(3); - expect(scope.displayedCollection).toEqual(refArray); - - ctrl.moveDataRow(1, 4); - expect(scope.displayedCollection.length).toBe(3); - expect(scope.displayedCollection).toEqual(refArray); - - ctrl.moveDataRow(-666, 'whatever'); - expect(scope.displayedCollection.length).toBe(3); - expect(scope.displayedCollection).toEqual(refArray); - }); - }); - - describe('sort data rows', function () { - - var refArray = [ - {id: 0, secondProperty: true, thirdProperty: 2}, - {id: 1, secondProperty: true, thirdProperty: 3}, - {id: 2, secondProperty: true, thirdProperty: 1} - ]; - - beforeEach(function () { - scope.displayedCollection = scope.dataCollection = [ - {id: 0, secondProperty: true, thirdProperty: 2}, - {id: 1, secondProperty: true, thirdProperty: 3}, - {id: 2, secondProperty: true, thirdProperty: 1} - ]; - ctrl.insertColumn({map: 'id', isSortable: true}); - ctrl.insertColumn({map: 'secondProperty', isSortable: false}); - ctrl.insertColumn({map: 'thirdProperty', isSortable: true}); - }); - - it('should not sort the displayed collection when isSortable is false', function () { - ctrl.sortBy(scope.columns[1]); - expect(scope.displayedCollection).toEqual(refArray); - }); - - //not really unit test but more relevant here... - it('should sort by "map", first ascending then descending finally back to natural order', function () { - - ctrl.sortBy(scope.columns[2]); - expect(scope.displayedCollection).toEqual([ - {id: 2, secondProperty: true, thirdProperty: 1}, - {id: 0, secondProperty: true, thirdProperty: 2}, - {id: 1, secondProperty: true, thirdProperty: 3} - ]); - - //switch to another column sortable - //by id - ctrl.sortBy(scope.columns[0]); - expect(scope.displayedCollection).toEqual([ - {id: 0, secondProperty: true, thirdProperty: 2}, - {id: 1, secondProperty: true, thirdProperty: 3}, - {id: 2, secondProperty: true, thirdProperty: 1} - ]); - - //back to thirdProperty - ctrl.sortBy(scope.columns[2]); - expect(scope.displayedCollection).toEqual([ - {id: 2, secondProperty: true, thirdProperty: 1}, - {id: 0, secondProperty: true, thirdProperty: 2}, - {id: 1, secondProperty: true, thirdProperty: 3} - ]); - - //descent - ctrl.sortBy(scope.columns[2]); - expect(scope.displayedCollection).toEqual([ - {id: 1, secondProperty: true, thirdProperty: 3}, - {id: 0, secondProperty: true, thirdProperty: 2}, - {id: 2, secondProperty: true, thirdProperty: 1} - ]); - - //natural order - ctrl.sortBy(scope.columns[2]); - expect(scope.displayedCollection).toEqual(refArray); - }); - }); - - describe('search data rows', function () { - - beforeEach(function () { - scope.itemsByPage = 10; - scope.displayedCollection = scope.dataCollection = [ - {id: 0, secondProperty: true, thirdProperty: 2}, - {id: 1, secondProperty: true, thirdProperty: 3}, - {id: 2, secondProperty: true, thirdProperty: 1} - ]; - ctrl.insertColumn({map: 'id', isSortable: true}); - ctrl.insertColumn({map: 'secondProperty', isSortable: false}); - ctrl.insertColumn({map: 'thirdProperty', isSortable: true}); - }); - - it('should not filter items with a null property by default', function () { - scope.dataCollection.push({id: 4, secondProperty: true, thirdProperty: null}); - ctrl.search(''); - expect(scope.displayedCollection.length).toBe(4); - expect(scope.displayedCollection).toEqual([ - {id: 0, secondProperty: true, thirdProperty: 2}, - {id: 1, secondProperty: true, thirdProperty: 3}, - {id: 2, secondProperty: true, thirdProperty: 1}, - {id: 4, secondProperty: true, thirdProperty: null} - ]); - }); - - it('should search globally if we dont specify a proper cololumn', function () { - ctrl.search('1'); - expect(scope.displayedCollection.length).toBe(2); - expect(scope.displayedCollection).toEqual([ - {id: 1, secondProperty: true, thirdProperty: 3}, - {id: 2, secondProperty: true, thirdProperty: 1} - ]); - }); - - it('should search for only a given column if we provide proper column', function () { - ctrl.search('1', scope.columns[0]); - expect(scope.displayedCollection.length).toBe(1); - expect(scope.displayedCollection).toEqual([ - {id: 1, secondProperty: true, thirdProperty: 3} - ]); - }); - - it('should switch form one mode to another without any problem', function () { - ctrl.search('1'); - expect(scope.displayedCollection.length).toBe(2); - expect(scope.displayedCollection).toEqual([ - {id: 1, secondProperty: true, thirdProperty: 3}, - {id: 2, secondProperty: true, thirdProperty: 1} - ]); - - ctrl.search('1', scope.columns[0]); - expect(scope.displayedCollection.length).toBe(1); - expect(scope.displayedCollection).toEqual([ - {id: 1, secondProperty: true, thirdProperty: 3} - ]); - - ctrl.search('1'); - expect(scope.displayedCollection.length).toBe(2); - expect(scope.displayedCollection).toEqual([ - {id: 1, secondProperty: true, thirdProperty: 3}, - {id: 2, secondProperty: true, thirdProperty: 1} - ]); - }); - }); - - describe('update data row', function () { - beforeEach(function () { - scope.displayedCollection = scope.dataCollection = [ - {id: 0, secondProperty: true, thirdProperty: 2, more: {another: 'test'}}, - {id: 1, secondProperty: true, thirdProperty: 3, more: {another: 'test'}}, - {id: 2, secondProperty: true, thirdProperty: 1, more: {another: 'test'}} - ]; - }); - - it('should update the proper data row with the proper value', function () { - ctrl.updateDataRow(scope.displayedCollection[0], 'id', 34); - expect(scope.displayedCollection).toEqual([ - {id: 34, secondProperty: true, thirdProperty: 2, more: {another: 'test'}}, - {id: 1, secondProperty: true, thirdProperty: 3, more: {another: 'test'}}, - {id: 2, secondProperty: true, thirdProperty: 1, more: {another: 'test'}} - ]); - - expect(scope.dataCollection).toEqual([ - {id: 34, secondProperty: true, thirdProperty: 2, more: {another: 'test'}}, - {id: 1, secondProperty: true, thirdProperty: 3, more: {another: 'test'}}, - {id: 2, secondProperty: true, thirdProperty: 1, more: {another: 'test'}} - ]); - }); - - it('should not update any data Row', function () { - ctrl.updateDataRow({id: 1, secondProperty: true, thirdProperty: 2}, 'id', 34); - expect(scope.displayedCollection).toEqual([ - {id: 0, secondProperty: true, thirdProperty: 2, more: {another: 'test'}}, - {id: 1, secondProperty: true, thirdProperty: 3, more: {another: 'test'}}, - {id: 2, secondProperty: true, thirdProperty: 1, more: {another: 'test'}} - ]); - - expect(scope.dataCollection).toEqual([ - {id: 0, secondProperty: true, thirdProperty: 2, more: {another: 'test'}}, - {id: 1, secondProperty: true, thirdProperty: 3, more: {another: 'test'}}, - {id: 2, secondProperty: true, thirdProperty: 1, more: {another: 'test'}} - ]); - }); - - it('should "create" a new property on the proper dataRow ', function () { - ctrl.updateDataRow(scope.displayedCollection[0], 'newProp', 'value'); - expect(scope.displayedCollection).toEqual([ - {id: 0, secondProperty: true, thirdProperty: 2, more: {another: 'test'}, newProp: 'value'}, - {id: 1, secondProperty: true, thirdProperty: 3, more: {another: 'test'}}, - {id: 2, secondProperty: true, thirdProperty: 1, more: {another: 'test'}} - ]); - - expect(scope.dataCollection).toEqual([ - {id: 0, secondProperty: true, thirdProperty: 2, more: {another: 'test'}, newProp: 'value'}, - {id: 1, secondProperty: true, thirdProperty: 3, more: {another: 'test'}}, - {id: 2, secondProperty: true, thirdProperty: 1, more: {another: 'test'}} - ]); - }); - - it('should work on multilevel object', function () { - ctrl.updateDataRow(scope.displayedCollection[0], 'more.another', 'validateTest'); - expect(scope.displayedCollection).toEqual([ - {id: 0, secondProperty: true, thirdProperty: 2, more: {another: 'validateTest'}}, - {id: 1, secondProperty: true, thirdProperty: 3, more: {another: 'test'}}, - {id: 2, secondProperty: true, thirdProperty: 1, more: {another: 'test'}} - ]); - - expect(scope.dataCollection).toEqual([ - {id: 0, secondProperty: true, thirdProperty: 2, more: {another: 'validateTest'}}, - {id: 1, secondProperty: true, thirdProperty: 3, more: {another: 'test'}}, - {id: 2, secondProperty: true, thirdProperty: 1, more: {another: 'test'}} - ]); - }); - - it('should emit an event', inject(function ($rootScope) { - var eventHandler = { - listener: function (event, args) { - expect(args.item).toEqual(scope.displayedCollection[0]); - } - }; - spyOn(eventHandler, 'listener'); - $rootScope.$on('updateDataRow', eventHandler.listener); - ctrl.updateDataRow(scope.displayedCollection[0], 'id', 2); - expect(eventHandler.listener).toHaveBeenCalled(); - })); - }); - }); -}); - - - http://git-wip-us.apache.org/repos/asf/aurora/blob/96c834a2/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/UtilitiesSpec.js ---------------------------------------------------------------------- diff --git a/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/UtilitiesSpec.js b/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/UtilitiesSpec.js deleted file mode 100644 index b4cc66d..0000000 --- a/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/UtilitiesSpec.js +++ /dev/null @@ -1,219 +0,0 @@ -describe('utilityModule Module', function () { - - var array; - - beforeEach(module('smartTable.utilities', function () { - - })); - - - describe('Array utilities', function () { - - beforeEach(function () { - array = [ - {id: 0}, - {id: 1}, - {id: 2} - ]; - }); - - it('should add item at proper index or put it at the end', inject(function (ArrayUtility) { - - var toInsert = {}; - //insert at index - ArrayUtility.insertAt(array, 1, toInsert); - expect(array.length).toBe(4); - expect(array[1]).toBe(toInsert); - - //at the end - ArrayUtility.insertAt(array, -4, toInsert); - expect(array.length).toBe(5); - expect(array[4]).toBe(toInsert); - - ArrayUtility.insertAt(array, 666, toInsert); - expect(array.length).toBe(6); - expect(array[5]).toBe(toInsert); - - ArrayUtility.insertAt(array, 'sfdsf', toInsert); - expect(array.length).toBe(7); - expect(array[6]).toBe(toInsert); - })); - - it('should remove item at proper index or do nothing', inject(function (ArrayUtility) { - - var removedElement = ArrayUtility.removeAt(array, 1); - expect(array.length).toBe(2); - expect(removedElement).toEqual({id: 1}); - - ArrayUtility.removeAt(array, -1); - expect(array.length).toBe(2); - - ArrayUtility.removeAt(array, 666); - expect(array.length).toBe(2); - - ArrayUtility.removeAt(array, '2323'); - expect(array.length).toBe(2); - })); - - it('should move an item from a lower index to an higher one', inject(function (ArrayUtility) { - ArrayUtility.moveAt(array, 0, 2); - expect(array.length).toBe(3); - expect(array[0].id).toBe(1); - expect(array[2].id).toBe(0); - })); - - it('should move an item from a higher index to an lower one', inject(function (ArrayUtility) { - ArrayUtility.moveAt(array, 2, 1); - expect(array.length).toBe(3); - expect(array[1].id).toBe(2); - expect(array[2].id).toBe(1); - })); - - it('should not move any item', inject(function (ArrayUtility) { - ArrayUtility.moveAt(array, -1, 2); - expect(array).toEqual([ - {id: 0}, - {id: 1}, - {id: 2} - ]); - ArrayUtility.moveAt(array, 1, 666); - expect(array).toEqual([ - {id: 0}, - {id: 1}, - {id: 2} - ]); - })); - - describe('sort array', function () { - var - predicate, - reverse; - - beforeEach(function () { - predicate = ''; - reverse = ''; - array = [ - {id: 0, name: 'laurent'}, - {id: 2, name: 'blandine'}, - {id: 1, name: 'francoise'} - ]; - }); - - - it('should return the array as it was if now algorithm is provided', inject(function (ArrayUtility) { - expect(ArrayUtility.sort(array, 'whaterver', predicate, reverse)).toEqual(array); - })); - - it('should sort array with provided algorithm', inject(function ($filter, ArrayUtility) { - expect(ArrayUtility.sort(array, $filter('orderBy'), predicate, reverse)).toEqual($filter('orderBy')(array, predicate, false)); - expect(ArrayUtility.sort(array), $filter('orderBy'), predicate, reverse).toEqual(array); //(no predicate has been provided - - predicate = 'id'; - expect(ArrayUtility.sort(array, $filter('orderBy'), predicate, reverse)).toEqual($filter('orderBy')(array, 'id', false)); - expect(ArrayUtility.sort(array, $filter('orderBy'), predicate, reverse)).toEqual([ - {id: 0, name: 'laurent'}, - {id: 1, name: 'francoise'}, - {id: 2, name: 'blandine'} - ]); - - var sortMock = { - sortAlgo: function (array, predicate, reverse) { - return array; - } - }; - predicate = 'id'; - reverse = true; - spyOn(sortMock, 'sortAlgo'); - ArrayUtility.sort(array, sortMock.sortAlgo, predicate, reverse); - expect(sortMock.sortAlgo).toHaveBeenCalledWith(array, 'id', true); - - })); - - it('should sort with reverse =true only if it is explicit set', inject(function ($filter, ArrayUtility) { - predicate = 'id'; - expect(ArrayUtility.sort(array, $filter('orderBy'), predicate, reverse)).toEqual($filter('orderBy')(array, 'id', false)); - expect(ArrayUtility.sort(array, $filter('orderBy'), predicate, reverse)).toEqual([ - {id: 0, name: 'laurent'}, - {id: 1, name: 'francoise'}, - {id: 2, name: 'blandine'} - ]); - reverse = 'whatever'; - expect(ArrayUtility.sort(array, $filter('orderBy'), predicate, reverse)).toEqual($filter('orderBy')(array, 'id', false)); - expect(ArrayUtility.sort(array, $filter('orderBy'), predicate, reverse)).toEqual([ - {id: 0, name: 'laurent'}, - {id: 1, name: 'francoise'}, - {id: 2, name: 'blandine'} - ]); - reverse = true; - expect(ArrayUtility.sort(array, $filter('orderBy'), predicate, reverse)).toEqual($filter('orderBy')(array, 'id', true)); - expect(ArrayUtility.sort(array, $filter('orderBy'), predicate, reverse)).toEqual([ - {id: 2, name: 'blandine'}, - {id: 1, name: 'francoise'}, - {id: 0, name: 'laurent'} - ]); - })); - }); - describe('filter utility', function () { - var predicate; - beforeEach(function () { - predicate = ''; - array = [ - {id: 0, name: 'laurent'}, - {id: 2, name: 'blandine'}, - {id: 1, name: 'francoise'} - ]; - }); - - it('should use provided algorithm or return input array', inject(function ($filter, ArrayUtility) { - expect(ArrayUtility.filter(array, 'whatever', predicate)).toEqual(array); - var filterMock = { - filterAlgo: function (array, predicate) { - return [array[0]]; - } - }; - spyOn(filterMock, 'filterAlgo').andCallThrough(); - predicate = 'whatever'; - var returnedArray = ArrayUtility.filter(array, filterMock.filterAlgo, predicate); - expect(filterMock.filterAlgo).toHaveBeenCalledWith(array, 'whatever'); - expect(returnedArray.length).toBe(1); - expect(returnedArray).toEqual([ - {id: 0, name: 'laurent'} - ]); - })); - }); - - describe('from/To', function () { - beforeEach(function () { - array = [ - {id: 0}, - {id: 1}, - {id: 2}, - {id: 3}, - {id: 4} - ]; - }); - - it('should return a part of the array', inject(function (ArrayUtility) { - var part = ArrayUtility.fromTo(array, 1, 3); - expect(part.length).toBe(3); - expect(part[0].id).toBe(1); - expect(part[1].id).toBe(2); - expect(part[2].id).toBe(3); - - part = ArrayUtility.fromTo(array, 3, 4); - expect(part.length).toBe(2); - expect(part[0].id).toBe(3); - expect(part[1].id).toBe(4); - - part = ArrayUtility.fromTo(array, -2, 2); - expect(part.length).toBe(2); - expect(part[0].id).toBe(0); - expect(part[1].id).toBe(1); - - part = ArrayUtility.fromTo(array, 1, -1); - expect(part.length).toBe(0); - })); - }); - - }); -}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/aurora/blob/96c834a2/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/directivesSpec.js ---------------------------------------------------------------------- diff --git a/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/directivesSpec.js b/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/directivesSpec.js deleted file mode 100644 index d5db5c2..0000000 --- a/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/directivesSpec.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -/* jasmine specs for directives go here */ - -describe('directives', function () { - -}); http://git-wip-us.apache.org/repos/asf/aurora/blob/96c834a2/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/filtersSpec.js ---------------------------------------------------------------------- diff --git a/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/filtersSpec.js b/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/filtersSpec.js deleted file mode 100644 index 8e9c271..0000000 --- a/3rdparty/javascript/scheduler/assets/bower_components/smart-table/test/unit/filtersSpec.js +++ /dev/null @@ -1,78 +0,0 @@ -describe('filter', function () { - - beforeEach(module('smartTable.filters')); - - describe('format filter', function () { - - var - filter, - format, - input, - parameter; - - beforeEach(inject(function ($injector) { - filter = $injector.get('$filter'); - format = filter('format'); - })); - - afterEach(function () { - input = ''; - parameter = ''; - }); - - it('should define format', function () { - expect(format).toBeDefined(); - }); - - it('should return the input value', function () { - input = 'input'; - expect(format(input)).toEqual(input); - }); - - it('should behave like date filter', function () { - input = new Date('2013/04/20'); - expect(format(input, 'date', parameter)).toEqual(filter('date')(input, parameter)); - parameter = 'MMMM'; - expect(format(input, 'date', parameter)).toEqual(filter('date')(input, parameter)); - }); - - it('should behave like currency filter', function () { - input = 2000; - expect(format(input, 'currency', parameter)).toEqual(filter('currency')(input, parameter)); - parameter = '$'; - expect(format(input, 'currency', parameter)).toEqual(filter('currency')(input), parameter); - }); - - it('should behave like json filter', function () { - input = {prop: 'value'}; - expect(format(input, 'json')).toEqual(filter('json')(input)); - }); - - it('should behave like lowercase filter', function () { - input = 'SldsrRS'; - expect(format(input, 'lowercase', parameter)).toEqual(filter('lowercase')(input, parameter)); - }); - - it('should behave like uppercase filter', function () { - input = 'SldsrRS'; - expect(format(input, 'uppercase', parameter)).toEqual(filter('uppercase')(input, parameter)); - }); - - it('should behave like number filter', function () { - input = 3434.34343; - expect(format(input, 'number', parameter)).toEqual(filter('number')(input, parameter)); - parameter = 2; - expect(format(input, 'number', parameter)).toEqual(filter('number')(input, parameter)); - }); - - it('should use the provided function', function () { - //will return the nth letter for example (dummy impl : no check on parameters etc) - var customFunction = function (value, parameter) { - return value[parameter - 1]; - }; - input = 'abcdefghij'; - expect(format(input, customFunction, 2)).toEqual('b'); - expect(format(input, customFunction, 3)).toEqual('c'); - }) - }); -}); http://git-wip-us.apache.org/repos/asf/aurora/blob/96c834a2/3rdparty/javascript/scheduler/assets/bower_components/underscore/.bower.json ---------------------------------------------------------------------- diff --git a/3rdparty/javascript/scheduler/assets/bower_components/underscore/.bower.json b/3rdparty/javascript/scheduler/assets/bower_components/underscore/.bower.json deleted file mode 100644 index 827f875..0000000 --- a/3rdparty/javascript/scheduler/assets/bower_components/underscore/.bower.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "underscore", - "version": "1.6.0", - "main": "underscore.js", - "keywords": [ - "util", - "functional", - "server", - "client", - "browser" - ], - "ignore": [ - "underscore-min.js", - "docs", - "test", - "*.yml", - "*.map", - "CNAME", - "index.html", - "favicon.ico", - "CONTRIBUTING.md" - ], - "homepage": "https://github.com/jashkenas/underscore", - "_release": "1.6.0", - "_resolution": { - "type": "version", - "tag": "1.6.0", - "commit": "1f4bf626f23a99f7a676f5076dc1b1475554c8f7" - }, - "_source": "git://github.com/jashkenas/underscore.git", - "_target": "~1.6.0", - "_originalSource": "underscore", - "_direct": true -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/aurora/blob/96c834a2/3rdparty/javascript/scheduler/assets/bower_components/underscore/.editorconfig ---------------------------------------------------------------------- diff --git a/3rdparty/javascript/scheduler/assets/bower_components/underscore/.editorconfig b/3rdparty/javascript/scheduler/assets/bower_components/underscore/.editorconfig deleted file mode 100644 index 8e92071..0000000 --- a/3rdparty/javascript/scheduler/assets/bower_components/underscore/.editorconfig +++ /dev/null @@ -1,14 +0,0 @@ -# This file is for unifying the coding style for different editors and IDEs -# editorconfig.org - -root = true - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[**.{js,json,html}] -indent_style = space -indent_size = 2 http://git-wip-us.apache.org/repos/asf/aurora/blob/96c834a2/3rdparty/javascript/scheduler/assets/bower_components/underscore/.gitignore ---------------------------------------------------------------------- diff --git a/3rdparty/javascript/scheduler/assets/bower_components/underscore/.gitignore b/3rdparty/javascript/scheduler/assets/bower_components/underscore/.gitignore deleted file mode 100644 index 029616c..0000000 --- a/3rdparty/javascript/scheduler/assets/bower_components/underscore/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -raw -node_modules http://git-wip-us.apache.org/repos/asf/aurora/blob/96c834a2/3rdparty/javascript/scheduler/assets/bower_components/underscore/LICENSE ---------------------------------------------------------------------- diff --git a/3rdparty/javascript/scheduler/assets/bower_components/underscore/LICENSE b/3rdparty/javascript/scheduler/assets/bower_components/underscore/LICENSE deleted file mode 100644 index 0d6b873..0000000 --- a/3rdparty/javascript/scheduler/assets/bower_components/underscore/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative -Reporters & Editors - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. http://git-wip-us.apache.org/repos/asf/aurora/blob/96c834a2/3rdparty/javascript/scheduler/assets/bower_components/underscore/README.md ---------------------------------------------------------------------- diff --git a/3rdparty/javascript/scheduler/assets/bower_components/underscore/README.md b/3rdparty/javascript/scheduler/assets/bower_components/underscore/README.md deleted file mode 100644 index c2ba259..0000000 --- a/3rdparty/javascript/scheduler/assets/bower_components/underscore/README.md +++ /dev/null @@ -1,22 +0,0 @@ - __ - /\ \ __ - __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ - /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ - \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ - \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ - \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ - \ \____/ - \/___/ - -Underscore.js is a utility-belt library for JavaScript that provides -support for the usual functional suspects (each, map, reduce, filter...) -without extending any core JavaScript objects. - -For Docs, License, Tests, and pre-packed downloads, see: -http://underscorejs.org - -Underscore is an open-sourced component of DocumentCloud: -https://github.com/documentcloud - -Many thanks to our contributors: -https://github.com/jashkenas/underscore/contributors http://git-wip-us.apache.org/repos/asf/aurora/blob/96c834a2/3rdparty/javascript/scheduler/assets/bower_components/underscore/bower.json ---------------------------------------------------------------------- diff --git a/3rdparty/javascript/scheduler/assets/bower_components/underscore/bower.json b/3rdparty/javascript/scheduler/assets/bower_components/underscore/bower.json deleted file mode 100644 index 6c6bbda..0000000 --- a/3rdparty/javascript/scheduler/assets/bower_components/underscore/bower.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "underscore", - "version": "1.6.0", - "main": "underscore.js", - "keywords": ["util", "functional", "server", "client", "browser"], - "ignore" : ["underscore-min.js", "docs", "test", "*.yml", "*.map", - "CNAME", "index.html", "favicon.ico", "CONTRIBUTING.md"] -} http://git-wip-us.apache.org/repos/asf/aurora/blob/96c834a2/3rdparty/javascript/scheduler/assets/bower_components/underscore/component.json ---------------------------------------------------------------------- diff --git a/3rdparty/javascript/scheduler/assets/bower_components/underscore/component.json b/3rdparty/javascript/scheduler/assets/bower_components/underscore/component.json deleted file mode 100644 index bb1775e..0000000 --- a/3rdparty/javascript/scheduler/assets/bower_components/underscore/component.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name" : "underscore", - "description" : "JavaScript's functional programming helper library.", - "keywords" : ["util", "functional", "server", "client", "browser"], - "repo" : "jashkenas/underscore", - "main" : "underscore.js", - "scripts" : ["underscore.js"], - "version" : "1.6.0", - "license" : "MIT" -} http://git-wip-us.apache.org/repos/asf/aurora/blob/96c834a2/3rdparty/javascript/scheduler/assets/bower_components/underscore/package.json ---------------------------------------------------------------------- diff --git a/3rdparty/javascript/scheduler/assets/bower_components/underscore/package.json b/3rdparty/javascript/scheduler/assets/bower_components/underscore/package.json deleted file mode 100644 index 86423ed..0000000 --- a/3rdparty/javascript/scheduler/assets/bower_components/underscore/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name" : "underscore", - "description" : "JavaScript's functional programming helper library.", - "homepage" : "http://underscorejs.org", - "keywords" : ["util", "functional", "server", "client", "browser"], - "author" : "Jeremy Ashkenas <[email protected]>", - "repository" : {"type": "git", "url": "git://github.com/jashkenas/underscore.git"}, - "main" : "underscore.js", - "version" : "1.6.0", - "devDependencies": { - "docco": "0.6.x", - "phantomjs": "1.9.0-1", - "uglify-js": "2.4.x" - }, - "scripts": { - "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true", - "build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m --source-map underscore-min.map -o underscore-min.js", - "doc": "docco underscore.js" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/jashkenas/underscore/master/LICENSE" - } - ], - "files" : ["underscore.js", "underscore-min.js", "LICENSE"] -}
