]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/blob
308957a6b8b1fbf4acde04f45d198b7e390aa836
[ceph.git] /
1 import { ComponentFixture, TestBed } from '@angular/core/testing';
2 import { of } from 'rxjs';
3
4 import { OverviewHealthCardComponent } from './overview-health-card.component';
5 import { SummaryService } from '~/app/shared/services/summary.service';
6 import { UpgradeService } from '~/app/shared/api/upgrade.service';
7 import { provideRouter, RouterModule } from '@angular/router';
8 import { CommonModule } from '@angular/common';
9 import { SkeletonModule, ButtonModule, LinkModule } from 'carbon-components-angular';
10 import { ComponentsModule } from '~/app/shared/components/components.module';
11 import { ProductiveCardComponent } from '~/app/shared/components/productive-card/productive-card.component';
12 import { PipesModule } from '~/app/shared/pipes/pipes.module';
13
14 describe('OverviewStorageCardComponent (Jest)', () => {
15   let component: OverviewHealthCardComponent;
16   let fixture: ComponentFixture<OverviewHealthCardComponent>;
17
18   const summaryServiceMock = {
19     summaryData$: of({
20       version:
21         'ceph version 13.1.0-419-g251e2515b5 (251e2515b563856349498c6caf34e7a282f62937) nautilus (dev)'
22     })
23   };
24
25   const upgradeServiceMock = {
26     listCached: jest.fn(() => of({ versions: [] }))
27   };
28
29   beforeEach(async () => {
30     await TestBed.configureTestingModule({
31       imports: [
32         OverviewHealthCardComponent,
33         CommonModule,
34         ProductiveCardComponent,
35         SkeletonModule,
36         ButtonModule,
37         RouterModule,
38         ComponentsModule,
39         LinkModule,
40         PipesModule
41       ],
42       providers: [
43         { provide: SummaryService, useValue: summaryServiceMock },
44         { provide: UpgradeService, useValue: upgradeServiceMock },
45         provideRouter([])
46       ]
47     }).compileComponents();
48
49     fixture = TestBed.createComponent(OverviewHealthCardComponent);
50     component = fixture.componentInstance;
51     fixture.detectChanges();
52   });
53
54   it('should create', () => {
55     expect(component).toBeTruthy();
56   });
57 });