diff options
Diffstat (limited to '')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/shared/services/language.service.spec.ts | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/language.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/language.service.spec.ts new file mode 100644 index 000000000..dacff44f0 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/language.service.spec.ts @@ -0,0 +1,34 @@ +import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; +import { TestBed } from '@angular/core/testing'; + +import { configureTestBed } from '~/testing/unit-test-helper'; +import { LanguageService } from './language.service'; + +describe('LanguageService', () => { + let service: LanguageService; + let httpTesting: HttpTestingController; + + configureTestBed({ + providers: [LanguageService], + imports: [HttpClientTestingModule] + }); + + beforeEach(() => { + service = TestBed.inject(LanguageService); + httpTesting = TestBed.inject(HttpTestingController); + }); + + afterEach(() => { + httpTesting.verify(); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); + + it('should call create', () => { + service.getLanguages().subscribe(); + const req = httpTesting.expectOne('ui-api/langs'); + expect(req.request.method).toBe('GET'); + }); +}); |