diff --git a/src/app/pages/recipe-upload-page/steps/enter-recipe-data/image-select/image-select.spec.ts b/src/app/pages/recipe-upload-page/steps/enter-recipe-data/image-select/image-select.spec.ts index acb818f..e5cc93c 100644 --- a/src/app/pages/recipe-upload-page/steps/enter-recipe-data/image-select/image-select.spec.ts +++ b/src/app/pages/recipe-upload-page/steps/enter-recipe-data/image-select/image-select.spec.ts @@ -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; + let imageService: Partial> = { + getOwnedImageViewsWithBlobUrls: vi.fn(() => + of({ + content: [], + slice: {} as SliceViewMeta, + count: 0, + } as SliceView), + ), + 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);