Example #1
0
 describe('with provided tabIndex', function () {
     var checkboxDebugElement;
     var checkboxNativeElement;
     var testComponent;
     var inputElement;
     var labelElement;
     testing_1.beforeEach(testing_1.async(function () {
         builder.createAsync(CheckboxWithTabIndex).then(function (f) {
             fixture = f;
             fixture.detectChanges();
             testComponent = fixture.debugElement.componentInstance;
             checkboxDebugElement = fixture.debugElement.query(platform_browser_1.By.directive(checkbox_1.MdCheckbox));
             checkboxNativeElement = checkboxDebugElement.nativeElement;
             inputElement = checkboxNativeElement.querySelector('input');
             labelElement = checkboxNativeElement.querySelector('label');
         });
     }));
     testing_1.it('should preserve any given tabIndex', testing_1.async(function () {
         expect(inputElement.tabIndex).toBe(7);
     }));
     testing_1.it('should preserve given tabIndex when the checkbox is disabled then enabled', function () {
         testComponent.isDisabled = true;
         fixture.detectChanges();
         testComponent.customTabIndex = 13;
         fixture.detectChanges();
         testComponent.isDisabled = false;
         fixture.detectChanges();
         expect(inputElement.tabIndex).toBe(13);
     });
 });
Example #2
0
 testing_1.describe('md-messages', function () {
     testing_1.it('should error if used outside of an NgFormControl', testing_1.async(testing_1.inject([], function () {
         return setup("<div md-messages></div>").catch(function (err) {
             testing_1.expect(err).toBeDefined();
         });
     })));
     testing_1.it('should initialize when given model and control group are present', testing_1.async(testing_1.inject([], function () {
         return setup().then(function (api) {
             testing_1.expect(api.container.isTouched).toBe(false);
             api.fixture.destroy();
         });
     })));
     testing_1.it('should bind local view references #ref="ngForm"', testing_1.async(testing_1.inject([], function () {
         return setup().then(function (api) {
             testing_1.expect(api.container.isTouched).toBe(false);
             testing_1.expect(api.messages.length).toBe(1);
             testing_1.expect(api.container.form).not.toBeNull();
             testing_1.expect(api.fixture.componentInstance.name).toBe('MorTon');
         });
     })));
     testing_1.it('should re-export valid from control or form', testing_1.async(testing_1.inject([], function () {
         return setup().then(function (api) {
             return util_1.promiseWait().then(function () {
                 var ctrl = api.container.property.control;
                 testing_1.expect(ctrl.value).toBe(null);
                 testing_1.expect(api.container.valid).toBe(false);
                 testing_1.expect(api.container.valid).toBe(ctrl.valid);
                 ctrl.updateValue('MorTon', { emitEvent: true });
                 api.fixture.detectChanges();
                 testing_1.expect(api.container.valid).toBe(true);
             });
         });
     })));
 });
Example #3
0
 testing_1.describe("initializing", function () {
     testing_1.it("data should be empty array if inputData is undefined or null", function () {
         var datatable = new DataTable_1.DataTable();
         datatable.ngOnChanges({ inputData: new core_1.SimpleChange(null, null) });
         datatable.ngDoCheck();
         testing_1.expect(datatable.data).toEqual([]);
     });
     testing_1.it("data should be equal to inputData", function () {
         datatable.ngDoCheck();
         testing_1.expect(datatable.data).toEqual(datatable.inputData);
     });
     testing_1.it("data should be 2 first items", function () {
         datatable.rowsOnPage = 2;
         datatable.ngDoCheck();
         testing_1.expect(datatable.data).toEqual([{ id: 3, name: 'Poland' }, { id: 1, name: 'Slovakia' }]);
     });
     testing_1.it("data should be 3. and 4. items", function () {
         datatable.rowsOnPage = 2;
         datatable.activePage = 2;
         datatable.ngDoCheck();
         testing_1.expect(datatable.data).toEqual([{ id: 2, name: 'Czech' }, { id: 5, name: 'Hungary' }]);
     });
     testing_1.it("shouldn't recalculate data when no changes", function () {
         datatable.ngDoCheck();
         var data = datatable.data;
         datatable.ngOnChanges({});
         datatable.ngDoCheck();
         testing_1.expect(datatable.data).toBe(data);
     });
 });
Example #4
0
 testing_1.describe("pagination", function () {
     testing_1.beforeEach(function () {
         datatable.rowsOnPage = 2;
         datatable.ngDoCheck();
     });
     testing_1.it("should return current page settings", function () {
         testing_1.expect(datatable.getPage()).toEqual({ activePage: 1, rowsOnPage: 2, dataLength: 5 });
     });
     testing_1.it("data should be 3. and 4. items when page change", function () {
         datatable.setPage(2, 2);
         datatable.ngDoCheck();
         testing_1.expect(datatable.data).toEqual([{ id: 2, name: 'Czech' }, { id: 5, name: 'Hungary' }]);
     });
     testing_1.it("data should be three first items when page change", function () {
         datatable.setPage(1, 3);
         datatable.ngDoCheck();
         testing_1.expect(datatable.data).toEqual([{ id: 3, name: 'Poland' }, { id: 1, name: 'Slovakia' }, { id: 2, name: 'Czech' }]);
     });
     testing_1.it("data should be two last items when page change", function () {
         datatable.setPage(2, 3);
         datatable.setPage(2, 3);
         datatable.ngDoCheck();
         testing_1.expect(datatable.data).toEqual([{ id: 5, name: 'Hungary' }, { id: 4, name: 'Ukraine' }]);
     });
 });
testing_1.describe('App: AngularWebsocketsDemo', function () {
    testing_1.it('should create the app', testing_1.inject([angular_websockets_demo_component_1.AngularWebsocketsDemoAppComponent], function (app) {
        testing_1.expect(app).toBeTruthy();
    }));
    testing_1.it('should have as title \'angular-websockets-demo works!\'', testing_1.inject([angular_websockets_demo_component_1.AngularWebsocketsDemoAppComponent], function (app) {
    }));
});
Example #6
0
describe('Service: Deferred', () => {
    let deferred;

    beforeEach(() => {
        deferred = new Deferred();
    });

    it('should be defined', () => {
        expect(deferred).toBeDefined();
    });

    it('should be able to resolved later', (done) => {
        deferred.then((result) => {
            expect(result).toBe('Resolved');
            done();
        });

        deferred.resolve('Resolved');
    });

    it('should be able to reject later', (done) => {
        deferred.then(() => {
            // Should not enter this block
        }).catch((err) => {
            expect(err).toBe('Rejected');
            done();
        });

        deferred.reject('Rejected');
    });
});
describe('schemaTools getValidators', () => {
	var formBuilder;
	beforeEach(() => {
		formBuilder = new FormBuilder();
	});

	it('creates [] as defaults for schema without required', () => {
		expect(getValidators(formBuilder, new Schema({ a: {} }))).toEqual(formBuilder.group({ a: [] }));
	});
	it('adds the required validator', () => {
		expect(getValidators(formBuilder, new Schema({ a: { require: true } }))).toEqual(formBuilder.group({ a: ['', Validators.required] }));
	});

	it('adds the required validator in nested Schema', () => {
		expect(getValidators(formBuilder, new Schema({
			a: { require: true },
			b: new Schema({
				c: { require: true },
			}),
		}))).toEqual(formBuilder.group({
			a: ['', Validators.required],
			b: formBuilder.group({ c: ['', Validators.required] }),
		}));
	});

});
Example #8
0
 describe('with provided aria-labelledby ', function () {
     var checkboxDebugElement;
     var checkboxNativeElement;
     var inputElement;
     testing_1.it('should use the provided aria-labelledby', testing_1.async(function () {
         builder.createAsync(CheckboxWithAriaLabelledby).then(function (f) {
             fixture = f;
             checkboxDebugElement = fixture.debugElement.query(platform_browser_1.By.directive(checkbox_1.MdCheckbox));
             checkboxNativeElement = checkboxDebugElement.nativeElement;
             inputElement = checkboxNativeElement.querySelector('input');
             fixture.detectChanges();
             expect(inputElement.getAttribute('aria-labelledby')).toBe('some-id');
         });
     }));
     testing_1.it('should not assign aria-labelledby if none is provided', testing_1.async(function () {
         builder.createAsync(SingleCheckbox).then(function (f) {
             fixture = f;
             checkboxDebugElement = fixture.debugElement.query(platform_browser_1.By.directive(checkbox_1.MdCheckbox));
             checkboxNativeElement = checkboxDebugElement.nativeElement;
             inputElement = checkboxNativeElement.querySelector('input');
             fixture.detectChanges();
             expect(inputElement.getAttribute('aria-labelledby')).toBe(null);
         });
     }));
 });
 testing_1.describe("addMeal", function () {
     testing_1.it("should call service to add meal", function () {
         component.new_meal = new meal_model_1.Meal("tacos", 10, 10, 10);
         component.addMeal();
         testing_1.expect(dietServiceMock.addMeal).toHaveBeenCalled();
     });
     testing_1.it("should reset new meal attribute", function () {
         component.new_meal = new meal_model_1.Meal("tacos", 10, 10, 10);
         component.addMeal();
         testing_1.expect(component.new_meal.name).toEqual(null);
         testing_1.expect(component.new_meal.protein).toEqual(null);
         testing_1.expect(component.new_meal.carbs).toEqual(null);
         testing_1.expect(component.new_meal.fat).toEqual(null);
     });
     testing_1.it("should set is_new attribute to false", function () {
         component.new_meal = new meal_model_1.Meal("tacos", 10, 10, 10);
         component.addMeal();
         testing_1.expect(component.is_new).toEqual(false);
     });
     testing_1.it("should retrieve the updated list from service", function () {
         component.new_meal = new meal_model_1.Meal("tacos", 10, 10, 10);
         component.addMeal();
         testing_1.expect(dietServiceMock.getMealList).toHaveBeenCalled();
     });
 });
Example #10
0
 testing_1.describe("sorting", function () {
     testing_1.it("id should return current sort setting", function () {
         datatable.setSort("id", "desc");
         testing_1.expect(datatable.getSort()).toEqual({ sortBy: "id", sortOrder: "desc" });
     });
     testing_1.it("shouldn't refresh data when set page with same settings", function () {
         datatable.setSort("name", "asc");
         datatable.ngDoCheck();
         var data = datatable.data;
         datatable.setSort("name", "asc");
         datatable.ngDoCheck();
         testing_1.expect(datatable.data).toBe(data);
     });
     testing_1.it("should sort data ascending by name", function () {
         datatable.setSort("name", "asc");
         datatable.ngDoCheck();
         testing_1.expect(datatable.data).toEqual([
             { id: 2, name: 'Czech' },
             { id: 5, name: 'Hungary' },
             { id: 3, name: 'Poland' },
             { id: 1, name: 'Slovakia' },
             { id: 4, name: 'Ukraine' }
         ]);
     });
 });
Example #11
0
 testing_1.describe('creation', function () {
     testing_1.it('should create the component correctly', testing_1.async(testing_1.inject([testing_1.TestComponentBuilder], function (tcb) {
         return tcb.createAsync(todo_cmp_1.TodoCmp).then(function (fixture) {
             fixture.detectChanges();
             var compiled = fixture.debugElement.nativeElement;
             testing_1.expect(compiled).toBeDefined();
         });
     })));
     testing_1.it('should inicialize the cmp correctly', testing_1.async(testing_1.inject([testing_1.TestComponentBuilder], function (tcb) {
         return tcb.createAsync(todo_cmp_1.TodoCmp).then(function (fixture) {
             var instance = fixture.debugElement.componentInstance;
             spyOn(instance, '_getAll').and.callFake(function () { });
             fixture.detectChanges();
             testing_1.expect(instance._getAll).toHaveBeenCalled();
         });
     })));
     testing_1.it('should call add correctly', testing_1.async(testing_1.inject([testing_1.TestComponentBuilder], function (tcb) {
         return tcb.createAsync(todo_cmp_1.TodoCmp).then(function (fixture) {
             fixture.detectChanges();
             var instance = fixture.debugElement.componentInstance;
             var _todoMsg = 'yo';
             instance.add(_todoMsg);
         });
     })));
     testing_1.it('should call remove correctly', testing_1.async(testing_1.inject([testing_1.TestComponentBuilder], function (tcb) {
         return tcb.createAsync(todo_cmp_1.TodoCmp).then(function (fixture) {
             fixture.detectChanges();
             var instance = fixture.debugElement.componentInstance;
             var _id = 'abc123';
             instance.remove(_id);
         });
     })));
 });
Example #12
0
describe('Shop service test', () => {
  let siteFixture = {
    list: [ 
      {
        name: 'site.ru',  
        articles: ['article 0', 'article 1'],
        adverts: ['advert 0'],
        copywriters: ['copywriter'],
        addArticle: () => siteFixture.active.articles.push('article 2'),
        addAdvert: () => siteFixture.active.adverts.push('advert 1'),
        addCopywriter: () => siteFixture.active.copywriters.push('copywriter')
      },
      {
        name: 'site2.ru'
      }
    ],
    active: {
      name: 'site.ru',
      articles: ['article 0', 'article 1'],
      adverts: ['advert 0'],
      copywriters: ['copywriter']
    }
  };

  let moneyFixture = {
    value: 10000,
    addMoney: income => {}
  };

  let shop = new ShopService(siteFixture, moneyFixture);

  it('getCount works only with lower case', () => {
    expect(shop.getCount('article')).toBe(2);
  });

  it('getPrice works only with lower case', () => {
    expect(shop.getPrice('article')).toBe(article_price(2));
  });

  describe('buy function', () => {
    console.log

    it('should buy article', () => {
      shop.buy('article', siteFixture.active.name);
      expect(shop.getCount('article')).toBe(3);
    });

    it('should buy advert', () => {
      shop.buy('advert', siteFixture.active.name);
      expect(shop.getCount('advert')).toBe(2);
    });

    it('should buy copywriter', () => {
      shop.buy('copywriter', siteFixture.active.name);
      expect(shop.getCount('copywriter')).toBe(2);
    });    
  });

});
testing_1.describe('App: Angular2cliproj', function () {
    testing_1.it('should create the app', testing_1.inject([angular2cliproj_component_1.Angular2cliprojAppComponent], function (app) {
        testing_1.expect(app).toBeTruthy();
    }));
    testing_1.it('should have as title \'angular2cliproj works!\'', testing_1.inject([angular2cliproj_component_1.Angular2cliprojAppComponent], function (app) {
        testing_1.expect(app.title).toEqual('angular2cliproj works!');
    }));
});
testing_1.describe('App: Angularattack2016Ghc', function () {
    testing_1.it('should create the app', testing_1.inject([angularattack2016_ghc_component_1.Angularattack2016GhcAppComponent], function (app) {
        testing_1.expect(app).toBeTruthy();
    }));
    testing_1.it('should have as title \'angularattack2016-ghc works!\'', testing_1.inject([angularattack2016_ghc_component_1.Angularattack2016GhcAppComponent], function (app) {
        testing_1.expect(app.title).toEqual('angularattack2016-ghc works!');
    }));
});
Example #15
0
testing_1.describe('App: Grouple', function () {
    testing_1.it('should create the app', testing_1.inject([app_1.App], function (app) {
        testing_1.expect(app).toBeTruthy();
    }));
    testing_1.it('should have as title \'Grouple\'', testing_1.inject([app_1.App], function (app) {
        testing_1.expect(app.title).toEqual('Grouple');
    }));
});
Example #16
0
testing_1.describe('Home Component : ', function () {
    testing_1.it('should create the app', testing_1.inject([home_component_1.HomeComponent], function (app) {
        testing_1.expect(app).toBeTruthy();
    }));
    testing_1.it('should say \'We Start Here\'', testing_1.inject([home_component_1.HomeComponent], function (app) {
        testing_1.expect(app.message.name).toBeTruthy('');
    }));
});
testing_1.describe('App: MyDreamApp', function () {
    testing_1.it('should create the app', testing_1.inject([app_component_1.AppComponent], function (app) {
        testing_1.expect(app).toBeTruthy();
    }));
    testing_1.it('should have as title \'app works!\'', testing_1.inject([app_component_1.AppComponent], function (app) {
        testing_1.expect(app.title).toEqual('app works!');
    }));
});
testing_1.describe('App: Ng2BoilerplateRouter', function () {
    testing_1.it('should create the app', testing_1.inject([ng2_boilerplate_router_component_1.Ng2BoilerplateRouterAppComponent], function (app) {
        testing_1.expect(app).toBeTruthy();
    }));
    testing_1.it('should have as title \'ng2-boilerplate-router works!\'', testing_1.inject([ng2_boilerplate_router_component_1.Ng2BoilerplateRouterAppComponent], function (app) {
        testing_1.expect(app.title).toEqual('ng2-boilerplate-router works!');
    }));
});
Example #19
0
testing_1.describe('Proof of life', function () {
    testing_1.it('should be true that 1 === 1', function () {
        testing_1.expect(1 === 1).toBe(true);
    });
    testing_1.it('should be true that 2 !== 1', function () {
        testing_1.expect(2 === 1).not.toBe(true);
    });
});
testing_1.describe('App: Ng2cli', function () {
    testing_1.it('should create the app', testing_1.inject([ng2cli_component_1.Ng2cliAppComponent], function (app) {
        testing_1.expect(app).toBeTruthy();
    }));
    testing_1.it('should have as title \'ng2cli works!\'', testing_1.inject([ng2cli_component_1.Ng2cliAppComponent], function (app) {
        testing_1.expect(app.title).toEqual('ng2cli works!');
    }));
});
 testing_1.describe("removeMeal", function () {
     testing_1.it("should call service to remove meal at provided index", function () {
         component.removeMeal(0);
         testing_1.expect(dietServiceMock.removeMeal).toHaveBeenCalled();
     });
     testing_1.it("should retrieve the updated list from service", function () {
         component.removeMeal(0);
         testing_1.expect(dietServiceMock.getMealList).toHaveBeenCalled();
     });
 });
  describe('#say', () => {
    it('greets to the given name', () => {
      const greeter = new Greeter();
      expect(greeter.say('Hello', 'Angular 2')).toEqual('Hello, Angular 2!');
    });

    it('capitalizes greeting', () => {
      const greeter = new Greeter();
      expect(greeter.say('hello', 'Angular 2')).toEqual('Hello, Angular 2!');
    });
  });
 testing_1.describe("ngOnInit", function () {
     testing_1.it("should initialize attributes", function () {
         component.ngOnInit();
         testing_1.expect(component.title).toEqual("Diet Component");
         testing_1.expect(component.meal_list).toBeDefined();
     });
     testing_1.it("should call service to initialize meal list", function () {
         component.ngOnInit();
         testing_1.expect(dietServiceMock.getMealList).toHaveBeenCalled();
     });
 });
 testing_1.describe('aria label', function () {
     testing_1.it('should set aria label from text content if not specified', function (done) {
         return builder.createAsync(MdIconLigatureTestApp).then(function (fixture) {
             var testComponent = fixture.debugElement.componentInstance;
             var mdIconElement = fixture.debugElement.nativeElement.querySelector('md-icon');
             testComponent.iconName = 'home';
             fixture.detectChanges();
             testing_1.expect(mdIconElement.getAttribute('aria-label')).toBe('home');
             testComponent.iconName = 'hand';
             fixture.detectChanges();
             testing_1.expect(mdIconElement.getAttribute('aria-label')).toBe('hand');
             done();
         });
     });
     testing_1.it('should use alt tag if aria label is not specified', function (done) {
         return builder.createAsync(MdIconLigatureWithAriaBindingTestApp).then(function (fixture) {
             var testComponent = fixture.debugElement.componentInstance;
             var mdIconElement = fixture.debugElement.nativeElement.querySelector('md-icon');
             testComponent.iconName = 'home';
             testComponent.altText = 'castle';
             fixture.detectChanges();
             testing_1.expect(mdIconElement.getAttribute('aria-label')).toBe('castle');
             testComponent.ariaLabel = 'house';
             fixture.detectChanges();
             testing_1.expect(mdIconElement.getAttribute('aria-label')).toBe('house');
             done();
         });
     });
     testing_1.it('should use provided aria label rather than icon name', function (done) {
         return builder.createAsync(MdIconLigatureWithAriaBindingTestApp).then(function (fixture) {
             var testComponent = fixture.debugElement.componentInstance;
             var mdIconElement = fixture.debugElement.nativeElement.querySelector('md-icon');
             testComponent.iconName = 'home';
             testComponent.ariaLabel = 'house';
             fixture.detectChanges();
             testing_1.expect(mdIconElement.getAttribute('aria-label')).toBe('house');
             done();
         });
     });
     testing_1.it('should use provided aria label rather than font icon', function (done) {
         return builder.createAsync(MdIconCustomFontCssTestApp).then(function (fixture) {
             var testComponent = fixture.debugElement.componentInstance;
             var mdIconElement = fixture.debugElement.nativeElement.querySelector('md-icon');
             testComponent.fontSet = 'f1';
             testComponent.fontIcon = 'house';
             testComponent.ariaLabel = 'home';
             fixture.detectChanges();
             testing_1.expect(mdIconElement.getAttribute('aria-label')).toBe('home');
             done();
         });
     });
 });
Example #25
0
testing_1.describe('FirebaseArray#constructor', function () {
    testing_1.it('should create an object', function () {
        var ref = firebaseDatabase.ref('posts');
        var posts = new data_service_1.FirebaseArray(ref);
        testing_1.expect(typeof posts).toBe('object');
    });
    testing_1.it('should be array like', function () {
        var ref = firebaseDatabase.ref('posts');
        var posts = new data_service_1.FirebaseArray(ref);
        testing_1.expect(posts.length).toBeDefined();
        testing_1.expect(posts.length).toBe(3);
    });
});
Example #26
0
testing_1.describe('AppComponent with TCB', function () {
    testing_1.it('should instantiate component', testing_1.async(testing_1.inject([testing_2.TestComponentBuilder], function (tcb) {
        tcb.createAsync(app_component_1.AppComponent).then(function (fixture) {
            testing_1.expect(fixture.componentInstance instanceof app_component_1.AppComponent).toBe(true, 'should create AppComponent');
        });
    })));
    testing_1.it('should have expected <h1> text', testing_1.async(testing_1.inject([testing_2.TestComponentBuilder], function (tcb) {
        tcb.createAsync(app_component_1.AppComponent).then(function (fixture) {
            var h1 = fixture.debugElement.query(function (el) { return el.name === 'h1'; }).nativeElement;
            h1 = fixture.debugElement.query(platform_browser_1.By.css('h1')).nativeElement;
            testing_1.expect(h1.innerText).toMatch(/angular 2 app/i, '<h1> should say something about "Angular 2 App"');
        });
    })));
});
testing_1.describe('Infinite Scroll Directive', function () {
    var createMockElement = function () {
        var mockedElement = new core_1.ElementRef(document.createElement('div'));
        return mockedElement;
    };
    testing_1.it('should create an instance of the directive', function () {
        var mockedElement = createMockElement();
        var actual = new infinite_scroll_1.InfiniteScroll(mockedElement);
        testing_1.expect(actual).toBeDefined();
    });
    testing_1.it('should have default @Input properties values', function () {
        var mockedElement = createMockElement();
        var directive = new infinite_scroll_1.InfiniteScroll(mockedElement);
        var expectedInputs = [
            '_distanceDown',
            '_distanceUp',
            '_throttle',
            'scrollWindow',
            '_immediate'
        ];
        expectedInputs.forEach(function (actualInput) {
            return testing_1.expect(directive[actualInput]).toBeDefined();
        });
    });
    testing_1.it('should trigger the onScrollDown event when scroll has passed _distandDown', function () {
        var mockedElement = createMockElement();
        var directive = new infinite_scroll_1.InfiniteScroll(mockedElement);
        spyOn(directive, 'onScrollDown');
        directive.ngOnInit();
        spyOn(directive.scroller, 'calculatePoints').and.callFake(function () {
            return { height: 150, scrolledUntilNow: 75, totalToScroll: 150 };
        });
        directive.scroller.handler();
        testing_1.expect(directive.scroller.calculatePoints).toHaveBeenCalled();
        testing_1.expect(directive.onScrollDown).toHaveBeenCalled();
    });
    testing_1.it('should trigger the onScrollUp event when scroll has passed _distanceUp', function () {
        var mockedElement = createMockElement();
        var directive = new infinite_scroll_1.InfiniteScroll(mockedElement);
        spyOn(directive, 'onScrollUp');
        directive.ngOnInit();
        spyOn(directive.scroller, 'calculatePoints').and.callFake(function () {
            return { height: 150, scrolledUntilNow: 30, totalToScroll: 150 };
        });
        directive.scroller.lastScrollPosition = 50;
        directive.scroller.handler();
        testing_1.expect(directive.scroller.calculatePoints).toHaveBeenCalled();
        testing_1.expect(directive.onScrollUp).toHaveBeenCalled();
    });
});
Example #28
0
describe('Money service test', () => {
  let money;

  beforeEach(() => {
    money = new MoneyService();
  });

  it('return correct amount of money', () => {
    expect(money.value).toBe(STARTUP_CAPITAL);
  });

  it('adds money', () => {
    expect(money.addMoney(100)).toBe(STARTUP_CAPITAL+100);
  });
});
 testing_1.describe('custom fonts', function () {
     testing_1.it('should apply CSS classes for custom font and icon', function (done) {
         mdIconRegistry.registerFontClassAlias('f1', 'font1');
         mdIconRegistry.registerFontClassAlias('f2');
         return builder.createAsync(MdIconCustomFontCssTestApp).then(function (fixture) {
             var testComponent = fixture.debugElement.componentInstance;
             var mdIconElement = fixture.debugElement.nativeElement.querySelector('md-icon');
             testComponent.fontSet = 'f1';
             testComponent.fontIcon = 'house';
             fixture.detectChanges();
             testing_1.expect(sortedClassNames(mdIconElement)).toEqual(['font1', 'house']);
             testing_1.expect(mdIconElement.getAttribute('aria-label')).toBe('house');
             testComponent.fontSet = 'f2';
             testComponent.fontIcon = 'igloo';
             fixture.detectChanges();
             testing_1.expect(sortedClassNames(mdIconElement)).toEqual(['f2', 'igloo']);
             testing_1.expect(mdIconElement.getAttribute('aria-label')).toBe('igloo');
             testComponent.fontSet = 'f3';
             testComponent.fontIcon = 'tent';
             fixture.detectChanges();
             testing_1.expect(sortedClassNames(mdIconElement)).toEqual(['f3', 'tent']);
             testing_1.expect(mdIconElement.getAttribute('aria-label')).toBe('tent');
             done();
         });
     });
 });
describe('FilterArrayPipe', () => {
	let pipe = FilterArrayPipe;
	beforeEach(() => {
		pipe = new FilterArrayPipe();
	});

	it('filter "fo" [{a:"foo"}, {b: "bar"}] to [{a:"foo"}]', () => {
		expect(pipe.transform([{a:'foo'}, {b: 'bar'}],['fo'])).toEqual([{a:'foo'}]);
	});
	it('filter "" [{a:"foo"}, {b: "bar"}] to [{a:"foo"}, {b: "bar"}]', () => {
		expect(pipe.transform([{a:'foo'}, {b: 'bar'}],[''])).toEqual([{a:'foo'}, {b: 'bar'}]);
	});
	it('filter "xx" [{a:"foo"}, {b: "bar"}] to []', () => {
		expect(pipe.transform([{a:'foo'}, {b: 'bar'}],['xx'])).toEqual([]);
	});
});