diff --git a/client/src/app/instance/store/effects/search.effects.spec.ts b/client/src/app/instance/store/effects/search.effects.spec.ts index 22d9148669ab208b726cba1abe287d0ae5da4a11..9f31362d75547b7f426dd0696ff949903155b7c6 100644 --- a/client/src/app/instance/store/effects/search.effects.spec.ts +++ b/client/src/app/instance/store/effects/search.effects.spec.ts @@ -1,5 +1,13 @@ -import { TestBed } from '@angular/core/testing'; +/** + * This file is part of Anis Client. + * + * @copyright Laboratoire d'Astrophysique de Marseille / CNRS + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +import { TestBed } from '@angular/core/testing'; import { provideMockActions } from '@ngrx/effects/testing'; import { EffectsMetadata, getEffectsMetadata } from '@ngrx/effects'; import { MockStore, provideMockStore } from '@ngrx/store/testing'; @@ -7,7 +15,6 @@ import { Observable, of } from 'rxjs'; import { cold, hot } from 'jasmine-marbles'; import { ToastrService } from 'ngx-toastr'; import { KeycloakService } from 'keycloak-angular'; - import { SearchEffects } from './search.effects'; import { SearchService } from '../services/search.service'; import * as searchActions from '../actions/search.actions'; @@ -50,7 +57,7 @@ describe('[Instance][Store] SearchEffects', () => { let mockAttributeSelectorSelectAttributeListIsLoaded; let mockConeSearchConfigSelectorSelectConeSearchConfigIsLoaded; let mockAuthSelectorSelectIsAuthenticated; - let keycloak = { getToken: jest.fn().mockImplementation(() => Promise.resolve('test'))}; + let keycloak = { getToken: jest.fn().mockImplementation(() => Promise.resolve('test')) }; beforeEach(() => { TestBed.configureTestingModule({ diff --git a/client/src/app/instance/store/services/archive.service.spec.ts b/client/src/app/instance/store/services/archive.service.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..a2c14e4cf813fae5b125f8dc01e1c6b4047ca552 --- /dev/null +++ b/client/src/app/instance/store/services/archive.service.spec.ts @@ -0,0 +1,58 @@ +/** + * This file is part of Anis Client. + * + * @copyright Laboratoire d'Astrophysique de Marseille / CNRS + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { HttpClientTestingModule, HttpTestingController } from "@angular/common/http/testing"; +import { TestBed, waitForAsync } from "@angular/core/testing"; +import { throwError } from "rxjs"; +import { AppConfigService } from "src/app/app-config.service"; +import { ArchiveService } from "./archive.service" + +describe('[instance][store][services] ArchiveService', () => { + let archiveService: ArchiveService; + let httpController: HttpTestingController; + let config: AppConfigService; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + providers: [ + ArchiveService, + { provide: AppConfigService, useValue: { + apiUrl: 'test', + }}, + + ] + }); + archiveService = TestBed.inject(ArchiveService); + config = TestBed.inject(AppConfigService); + httpController = TestBed.inject(HttpTestingController); + + })); + it('#startTaskCreateArchive() should request return an Observable<any>', () => { + + archiveService.startTaskCreateArchive('test').subscribe(); + const url = 'test/start-task-create-archive/test'; + const mockRequest = httpController.expectOne({ method: 'GET', url: `${url}`,}); + + }); + it('#isArchiveAvailable() should request return an Observable<any>', () => { + + archiveService.isArchiveAvailable('1').subscribe(); + const url = 'test/is-archive-available/1'; + const mockRequest = httpController.expectOne({ method: 'GET', url: `${url}`,}); + + }); + + + + + + + +}) \ No newline at end of file diff --git a/client/src/app/instance/store/services/index.spec.ts b/client/src/app/instance/store/services/index.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..af070afd8f4b46b57da6891de1519f558255dc45 --- /dev/null +++ b/client/src/app/instance/store/services/index.spec.ts @@ -0,0 +1,16 @@ +/** + * This file is part of Anis Client. + * + * @copyright Laboratoire d'Astrophysique de Marseille / CNRS + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { instanceServices } from "." + +describe('[instance][store][services] index', () => { + it('test index', () => { + expect(instanceServices.length).toEqual(4); + }); +}) \ No newline at end of file