mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-23 10:39:25 -05:00
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { TestBed } from '@angular/core/testing'
|
|
|
|
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'
|
|
import {
|
|
HttpTestingController,
|
|
provideHttpClientTesting,
|
|
} from '@angular/common/http/testing'
|
|
import { environment } from 'src/environments/environment'
|
|
import { SystemStatusService } from './system-status.service'
|
|
|
|
describe('SystemStatusService', () => {
|
|
let httpTestingController: HttpTestingController
|
|
let service: SystemStatusService
|
|
|
|
beforeEach(() => {
|
|
TestBed.configureTestingModule({
|
|
imports: [],
|
|
providers: [
|
|
SystemStatusService,
|
|
provideHttpClient(withInterceptorsFromDi()),
|
|
provideHttpClientTesting(),
|
|
],
|
|
})
|
|
|
|
httpTestingController = TestBed.inject(HttpTestingController)
|
|
service = TestBed.inject(SystemStatusService)
|
|
})
|
|
|
|
afterEach(() => {
|
|
httpTestingController.verify()
|
|
})
|
|
|
|
it('calls get status endpoint', () => {
|
|
service.get().subscribe()
|
|
const req = httpTestingController.expectOne(
|
|
`${environment.apiBaseUrl}status/`
|
|
)
|
|
expect(req.request.method).toEqual('GET')
|
|
})
|
|
})
|