fix: Fix thumbnail rendering issues (#2058)

- Closes #2054
This commit is contained in:
Dermot Duffy
2025-05-22 21:21:04 -07:00
committed by GitHub
parent 95c926e237
commit c342c5d529
6 changed files with 45 additions and 26 deletions
@@ -1,9 +1,9 @@
import { describe, expect, it } from 'vitest';
import { mock } from 'vitest-mock-extended';
import { CameraManager } from '../../../../src/camera-manager/manager';
import { ThumbnailDetailsController } from '../../../../src/components-lib/thumbnail/details-controller';
import { ViewFolder, ViewMediaType } from '../../../../src/view/item';
import { createFolder, TestViewMedia } from '../../../test-utils';
import { CameraManager } from '../../../src/camera-manager/manager';
import { ThumbnailDetailsController } from '../../../src/components-lib/thumbnail/details-controller';
import { ViewFolder, ViewMediaType } from '../../../src/view/item';
import { createFolder, TestViewMedia } from '../../test-utils';
describe('ThumbnailDetailsController', () => {
describe('should set heading', () => {
@@ -117,6 +117,22 @@ describe('ThumbnailDetailsController', () => {
},
]);
});
it('should not have title with a what and a start time', () => {
const item = new TestViewMedia({
title: 'Test Event',
what: ['person', 'car'],
startTime: new Date('2025-05-22T21:12:00Z'),
});
const controller = new ThumbnailDetailsController();
controller.calculate(null, item);
expect(controller.getDetails()).not.toContainEqual(
expect.objectContaining({
title: 'Test Event',
}),
);
});
});
it('should have start time in details', () => {