Skip to content

Commit a70bb43

Browse files
committed
test(book-detail): deactivate all tests
1 parent 5e4535a commit a70bb43

File tree

1 file changed

+6
-31
lines changed

1 file changed

+6
-31
lines changed

src/app/book/book-detail/book-detail.component.spec.ts

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,14 @@ import { BookDataService } from '../shared/book-data.service';
44
import { ComponentFixture, TestBed, inject } from '@angular/core/testing';
55

66
import { BookDetailComponent } from './book-detail.component';
7-
import { DebugElement, Component, NO_ERRORS_SCHEMA } from '@angular/core';
7+
import { DebugElement, Component } from '@angular/core';
88
import { ActivatedRoute, Router } from '@angular/router';
99
import { Location } from "@angular/common";
1010
import { Observable } from 'rxjs';
1111

12-
export class MockActivatedRoute {
13-
parent: any;
14-
params: any;
15-
snapshot = {};
16-
17-
constructor(options) {
18-
this.parent = options.parent;
19-
this.params = options.params;
20-
}
21-
}
22-
23-
2412
describe('BookDetailComponent', () => {
2513
let component: BookDetailComponent;
2614
let fixture: ComponentFixture<BookDetailComponent>;
27-
let router: Router;
28-
let location: Location;
29-
let serviceSpy: jasmine.Spy;
3015

3116
beforeEach(() => {
3217
TestBed.configureTestingModule({
@@ -36,33 +21,23 @@ describe('BookDetailComponent', () => {
3621
imports: [
3722
RouterTestingModule
3823
],
39-
providers: [
40-
{ provide: BookDataService, useClass: BookStaticAsyncDataService },
41-
{
42-
provide: ActivatedRoute,
43-
useValue: new MockActivatedRoute({
44-
params: Observable.of({ isbn: '978-0-20163-361-0' }),
45-
parent: new MockActivatedRoute({})
46-
})
47-
}
48-
]
24+
providers: []
4925
})
5026
.compileComponents();
5127
});
5228

5329
beforeEach(inject([BookDataService], (service: BookDataService) => {
5430
fixture = TestBed.createComponent(BookDetailComponent);
5531
component = fixture.componentInstance;
56-
serviceSpy = spyOn(service, 'getBookByIsbn').and.callThrough();
5732
fixture.detectChanges();
5833
}));
5934

60-
it('should read a book via BookData service', () => {
61-
expect(serviceSpy.calls.argsFor(0)).toEqual(['978-0-20163-361-0']);
35+
it('should call the BookData service with the correct ISBN', () => {
36+
expect(true).toBeFalsy();
6237
});
6338

64-
it('should load the book to the component', () => {
65-
expect(component.book.isbn).toBe('978-0-20163-361-0');
39+
it('should load the book to the component to component.book', () => {
40+
expect(true).toBeFalsy();
6641
});
6742

6843
});

0 commit comments

Comments
 (0)