Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
interface ColumnScope extends IScope {
$column: { data?: SelectData };
$selectData?: SelectOption[];
}
interface TableScope extends IScope {
$new(): ColumnScope;
}
let $scope: ColumnScope,
elem: string,
$compile: ICompileService;
beforeAll(() => expect(ngTableBrowserModule).toBeDefined());
beforeEach(ng1.mock.module('ngTable-browser'));
beforeEach(inject(($rootScope: TableScope, _$compile_: ICompileService) => {
$scope = $rootScope.$new();
$compile = _$compile_;
elem = '<select></select>';
}));
describe('array datasource', () => {
it('should add array to current scope', () => {
// given
let data = [{ id: 1, title: 'A' }];
$scope.$column = {
data: data
};
// when
beforeEach(() => {
angular.mock.module('jm.i18next', ($i18nextProvider: ng.IServiceProvider) => {
i18next.init(i18nextOptions, (err, t) => {
// console.log('resources loaded');
});
i18next.on('initialized', (options) => {
// console.log('i18next initialized');
i18nextOptions = options;
});
});
inject((
_$i18next_: Ii18nTranslateService,
_$timeout_: ng.ITimeoutService,
_$rootScope_: ng.IRootScopeService) => {
$i18next = _$i18next_;
$timeout = _$timeout_;
describe('ngeo.download.Csv', () => {
/** @type {import("ngeo/download/Csv.js").DownloadCsvService} */
let ngeoCsvDownload;
beforeEach(angular.mock.inject((_ngeoCsvDownload_) => {
ngeoCsvDownload = _ngeoCsvDownload_;
}));
describe('#generateCsv', () => {
it('deals with no data', () => {
expect(ngeoCsvDownload.generateCsv([], [])).toBe('');
});
it('generates a CSV', () => {
const columnDefs = [{name: 'col 1'}, {name: 'col 2'}, {name: 'col 3'}];
const data = [{
'col 1': 'some text',
'col 2': 123,
'col 3': true,
'column that should be ignored': 'some text'
}, {
describe('Tour Config', function () {
var $compile,
$templateCache,
$rootScope,
$q,
TourConfig,
digestAfter = function (fn, argumentArray) {
fn.apply(null, argumentArray || []);
$rootScope.$digest();
};
beforeEach(angular.mock.module('bm.uiTour'));
beforeEach(angular.mock.inject(function (_$compile_, _$templateCache_, _$rootScope_, _$q_, _TourConfig_) {
$compile = _$compile_;
$templateCache = _$templateCache_;
$rootScope = _$rootScope_;
$q = _$q_;
TourConfig = _TourConfig_;
}));
it('should initialize a new tour with default options when no options are passed', function () {
//given
var scope = $rootScope.$new(),
config;
$compile($templateCache.get('tour-with-no-config.html'))(scope);
//when
$rootScope.$digest();
getItems: function() {
return this.state.get('items')
},
},
}
})
.store('MyStoreC', function() {
return {
initialize: function() {
this.state = this.immutable({ items: [] }, { asynchronous: true })
},
exports: {},
}
})
angular.mock.module('test')
}
'resize-edges="{top: true, bottom: true}" ' +
'on-resize-start="onResizeStart()" ' +
'on-resize-end="onResizeEnd(x, y)" ' +
'on-resize="onResize(x, y)" ' +
'>';
function prepareScope(vm) {
//These variables MUST be set as a minimum for the calendar to work
vm.resizable = true;
vm.dropData = 'myData';
vm.onResizeStart = sinon.spy();
vm.onResize = sinon.spy();
vm.onResizeEnd = sinon.spy();
}
beforeEach(angular.mock.module('mwl.calendar'));
beforeEach(angular.mock.module(function($provide) {
interact = sinon.stub();
interact.createSnapGrid = sinon.spy();
$provide.constant('interact', interact);
}));
beforeEach(angular.mock.inject(function(_$compile_, _$rootScope_, _$timeout_) {
$compile = _$compile_;
$rootScope = _$rootScope_;
$timeout = _$timeout_;
scope = $rootScope.$new();
prepareScope(scope);
interactInstance = {
resizable: sinon.spy(),
beforeEach(() => {
angular.mock.module(file_field_module);
angular.mock.inject(function(
_$q_,
_TuleapArtifactModalFileUploadService_
) {
$q = _$q_;
TuleapArtifactModalFileUploadService = _TuleapArtifactModalFileUploadService_;
});
installPromiseMatchers();
});
describe('Inventory list container', () => {
let scope;
let createElement;
let element;
const body = angular.element('body');
beforeEach(angular.mock.module('@talend/react-components.containers'));
beforeEach(inject(($rootScope, $compile, SettingsService) => {
scope = $rootScope.$new(true);
createElement = () => {
element = angular.element(`
beforeEach(function() {
angular.mock.module(kanban_module);
var $controller,
$rootScope;
angular.mock.inject(function(
_$controller_,
_$q_,
_$rootScope_,
_SharedPropertiesService_,
_DiagramRestService_
) {
$controller = _$controller_;
$q = _$q_;
$rootScope = _$rootScope_;
SharedPropertiesService = _SharedPropertiesService_;
DiagramRestService = _DiagramRestService_;
});
$scope = $rootScope.$new();
kanban_id = 2;
beforeEach(() => {
angular.mock.module(execution_module);
let $controller, $rootScope;
angular.mock.inject(function(
_$controller_,
_$q_,
_$rootScope_,
_ExecutionRestService_,
_SharedPropertiesService_
) {
$controller = _$controller_;
$q = _$q_;
$rootScope = _$rootScope_;
ExecutionRestService = _ExecutionRestService_;
SharedPropertiesService = _SharedPropertiesService_;
});