This file contains 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
{"lastUpload":"2020-08-20T09:11:43.945Z","extensionVersion":"v3.4.3"} |
This file contains 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 add the values', () => { | |
const result = addValues(2, 4); | |
expect(result).toBe(6); | |
}); | |
let addValues = (value1, value2) {} |
This file contains 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 add the values', () => { | |
const result = addValues(2, 4); | |
expect(result).toBe(6); | |
}); | |
let addValues = (value1, value2) { | |
return value1 + value2; | |
} |
This file contains 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
describe('Render', () => { | |
beforeEach(() => { | |
fixture.detectChanges(); | |
}); | |
it('should have a title', () => { | |
const titleElements = fixture.debugElement.queryAll(By.css('h1')); | |
expect(titleElements.length).toBe(1); | |
expect(titleElements[0].nativeElement.innerHTML).toBe('Favorite movies'); |
This file contains 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
<h1>Favorite movies</h1> |
This file contains 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('show all the favorite movies', () => { | |
const movieElements = fixture.debugElement.queryAll(By.css('.movie')); | |
expect(movieElements.length).toBe(favoriteMoviesToUse.length); | |
}); |
This file contains 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
const favoriteMoviesToUse: Movie[] = [ | |
{ title: 'Interstellar' } as Movie, | |
{ title: 'The big Lebowski' } as Movie, | |
{ title: 'Fences' } as Movie | |
]; | |
describe('FavoriteMoviesComponent', () => { | |
beforeEach(() => { | |
fixture = TestBed.createComponent(FavoriteMoviesComponent); | |
component = fixture.componentInstance; |
This file contains 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
<div class="movie" *ngFor="let movie of favoriteMovies"> | |
{{ movie.title }} | |
</div> |
This file contains 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
const favoriteMoviesToUse: Movie[] = [ | |
{ title: 'Interstellar' } as Movie, | |
{ title: 'The big Lebowski' } as Movie, | |
{ title: 'Borat' } as Movie | |
]; | |
describe('FavoriteMoviesComponent', () => { | |
let component: FavoriteMoviesComponent; | |
let fixture: ComponentFixture<FavoriteMoviesComponent>; | |
let favoriteMovieService: FavoriteMoviesService; |
This file contains 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
@Component({ | |
selector: 'app-favorite-movies', | |
templateUrl: './favorite-movies.component.html', | |
styleUrls: ['./favorite-movies.component.scss'] | |
}) | |
export class FavoriteMoviesComponent implements OnInit { | |
favoriteMovies$: Observable<Movie[]>; | |
error: string; | |
constructor(private favoriteMovieService: FavoriteMoviesService) {} |
OlderNewer