This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('example actions', function () { | |
| // given: | |
| var html = app.runHtml('<greeting name="defaultName"/>', {defaultName: 'John'}); | |
| // when: | |
| html.perform( | |
| type('Jane').in('input.name'), | |
| click.in('button#hello') | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('sets the strength to "strong" if the password length is >8 chars', function() { | |
| var $scope = {}; | |
| var controller = $controller('PasswordController', { $scope: $scope }); | |
| $scope.password = 'longerthaneightchars'; | |
| $scope.grade(); | |
| expect($scope.strength).toEqual('strong'); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('group of components test', function () { | |
| const html = app.runHtml(`<div> | |
| <my-first-component></my-first-component> | |
| <my-second-component></my-second-component> | |
| </div>`); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('should fetch authentication token', function() { | |
| let GET_received = false; | |
| server.get('auth.py', req => { | |
| GET_received = true; | |
| req.sendStatus(200); | |
| }); | |
| const html = app.runHtml('<my-component></my-component>'); | |
| expect(GET_received).toBeTruthy(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('should fetch authentication token', function() { | |
| $httpBackend.expectGET('/auth.py'); | |
| var controller = createController(); | |
| $httpBackend.flush(); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('value in input text should should be set', (done) => { | |
| const stubFunc = jasmine.createSpy('spy'); | |
| const html = app.runHtml('<search-team-input on-search-change="searchCompetitions($text)"></search-team-input>', | |
| {searchCompetitions: stubFunc}); | |
| html.perform( | |
| type('2017').in('.year') | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module(module) | |
| .run((_$rootScope_, _$state_, _SearchService_) => { | |
| $scope = _$rootScope_.$new(); | |
| $state = _$state_; | |
| searchService = _SearchService_; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| it('serviceshould be extecuted once', () => { | |
| const html = app.runHtml('<home-component></home-component>'); | |
| searchService.showMe(); | |
| expect(searchService.showMe.calls.count()).toBe(1); // Error | |
| }); | |
| it('serviceshould be extecuted once', () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular.module(HomeModule.name) | |
| .run((_homeService_) => { | |
| homeService = _homeService_; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| angular | |
| .module('app', []) | |
| .component('counter', { | |
| template: '<div class="counter"></div>', | |
| controllerAs: 'ctrl', | |
| controller: function () { | |
| const self = this; | |
| } | |
| }); |
NewerOlder