From 64b3cf92f72d5cf4115a9cbeb21c51f9c0dfeb87 Mon Sep 17 00:00:00 2001 From: Jesse Brault Date: Sat, 7 Feb 2026 21:28:40 -0600 Subject: [PATCH] MME-8 Prepare image-select.spec for use. --- .../image-select/image-select.spec.ts | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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);