Example #1
0
 beforeEach(async () => {
     mockApp();
     $state = await getComponent("$state");
     $stateParams = await getComponent("$stateParams");
     $rootScope = await getComponent("$rootScope");
     $timeout = await getComponent("$timeout");
 });
Example #2
0
    test("All states use require as template", async () => {
        const $state: any = await getComponent("$state");
        _.each($state.get(), state => {
            if (state.templateUrl) {
                console.error("You should use 'template: require(...)' with state:", state.name);
            }
            expect(state.templateUrl).toBeFalsy();
            expect(!state.template && !state.abstract && _.isEmpty(state.views)).toBeFalsy();

            if (!_.isEmpty(state.views)) {
                _.each(state.views, view => {
                    expect(_.isString(view.template)).toBeTruthy();
                });
            }
        });
    });
Example #3
0
 beforeEach(async () => {
     mockApp();
     Api = await getComponent("Api");
 });
 beforeEach(async () => {
     mockApp();
     PerusteenRakenne = await getComponent("PerusteenRakenne");
 });
 beforeEach(async () => {
     mockApp();
     SuoritustavanSisalto = await getComponent("SuoritustavanSisalto");
 });
Example #6
0
 test("Modules can be injected with getComponent", async () => {
     const $rootScope = await getComponent("$rootScope");
     const $timeout: any = await getComponent("$timeout");
     expect($rootScope).toBeTruthy();
     $timeout.flush();
 });
Example #7
0
 beforeEach(async () => {
     mockApp();
     virheService = await getComponent("virheService");
 });
 beforeEach(async () => {
     Algoritmit = await getComponent("Algoritmit");
 });
 beforeEach(async () => {
     mockApp();
     YleinenData = await getComponent("YleinenData");
 });