MME-8 Prepare image-select.spec for use.
This commit is contained in:
parent
8c0a4dd9f4
commit
64b3cf92f7
@ -1,14 +1,36 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ImageSelect } from './image-select';
|
||||
import { Mocked } from 'vitest';
|
||||
import { ImageService } from '../../../../../shared/services/ImageService';
|
||||
import { of } from 'rxjs';
|
||||
import { SliceView, SliceViewMeta } from '../../../../../shared/models/SliceView.model';
|
||||
import { ImageViewWithBlobUrl } from '../../../../../shared/client-models/ImageViewWithBlobUrl';
|
||||
|
||||
describe('ImageSelect', () => {
|
||||
let component: ImageSelect;
|
||||
let fixture: ComponentFixture<ImageSelect>;
|
||||
|
||||
let imageService: Partial<Mocked<ImageService>> = {
|
||||
getOwnedImageViewsWithBlobUrls: vi.fn(() =>
|
||||
of({
|
||||
content: [],
|
||||
slice: {} as SliceViewMeta,
|
||||
count: 0,
|
||||
} as SliceView<ImageViewWithBlobUrl>),
|
||||
),
|
||||
getOwnedImagesCount: vi.fn(() => of(0)),
|
||||
deleteImage: vi.fn(() => of()),
|
||||
};
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [ImageSelect],
|
||||
providers: [
|
||||
{
|
||||
provide: ImageService,
|
||||
useValue: imageService,
|
||||
},
|
||||
],
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ImageSelect);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user