diff --git a/src/app/adapters/secondary/genres-adapter.service.spec.ts b/src/app/adapters/secondary/genres-adapter.service.spec.ts index beba5a5..dfeebc4 100644 --- a/src/app/adapters/secondary/genres-adapter.service.spec.ts +++ b/src/app/adapters/secondary/genres-adapter.service.spec.ts @@ -4,7 +4,7 @@ import { of, throwError } from 'rxjs'; import {GenresAdapterService} from "./genres-adapter.service"; import {Genre} from "../../domain/genre"; -describe('HeroAdapterService', () => { +describe('GenreAdapterService', () => { let service: GenresAdapterService; let httpClientSpy: jasmine.SpyObj; @@ -21,14 +21,14 @@ describe('HeroAdapterService', () => { }); it('should return expected genres', (done: DoneFn) => { - const expectedHeroes: Genre[] = + const expectedGenres: Genre[] = [{ label: "A", subGenres: [] }, { label: "B", subGenres: [] }]; - httpClientSpy.get.and.returnValue(of(expectedHeroes)); + httpClientSpy.get.and.returnValue(of(expectedGenres)); service.getGenres().subscribe({ next: genres => { - expect(genres).toEqual(expectedHeroes); + expect(genres).toEqual(expectedGenres); done(); }, error: done.fail diff --git a/src/app/adapters/secondary/genres-adapter.service.ts b/src/app/adapters/secondary/genres-adapter.service.ts index 2a9fff1..18ae2d8 100644 --- a/src/app/adapters/secondary/genres-adapter.service.ts +++ b/src/app/adapters/secondary/genres-adapter.service.ts @@ -8,12 +8,12 @@ import {Genre} from "../../domain/genre"; @Injectable({ providedIn: 'root' }) export class GenresAdapterService implements IManageGenres { - private heroesUrl = 'api/genres'; // URL to web api + private genresUrl = 'api/genres'; constructor(private http: HttpClient) { } getGenres(): Observable { - return this.http.get(this.heroesUrl).pipe( + return this.http.get(this.genresUrl).pipe( catchError(this.handleHttpError()) ); } diff --git a/src/app/adapters/test.spec.ts b/src/app/adapters/test.spec.ts deleted file mode 100644 index e7d914d..0000000 --- a/src/app/adapters/test.spec.ts +++ /dev/null @@ -1,20 +0,0 @@ -import {JsonFilesService} from "../services/json-files.service"; -import {TestBed} from "@angular/core/testing"; -import {HttpClient} from "@angular/common/http"; - -describe('HeroAdapterService', () => { - let service: JsonFilesService; - let httpClientSpy: jasmine.SpyObj; - - beforeEach(() => { - httpClientSpy = jasmine.createSpyObj('HttpClient', ['get', 'post', 'put', 'delete']); - TestBed.configureTestingModule({ - providers: [{ provide: HttpClient, useValue: httpClientSpy }] - }); - service = TestBed.inject(JsonFilesService); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -});