mirror of
https://github.com/immich-app/immich.git
synced 2025-11-24 23:40:45 +09:00
fix(web): ensure shared link covers are full size (#12386)
This commit is contained in:
@@ -13,6 +13,6 @@ describe('AssetCover component', () => {
|
||||
expect(img.alt).toBe('123');
|
||||
expect(img.getAttribute('src')).toBe('wee');
|
||||
expect(img.getAttribute('loading')).toBe('eager');
|
||||
expect(img.className).toBe('z-0 rounded-xl object-cover aspect-square asdf');
|
||||
expect(img.className).toBe('size-full rounded-xl object-cover aspect-square asdf');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ describe('NoCover component', () => {
|
||||
});
|
||||
const img = component.getByTestId('album-image') as HTMLImageElement;
|
||||
expect(img.alt).toBe('123');
|
||||
expect(img.className).toBe('z-0 rounded-xl object-cover aspect-square asdf');
|
||||
expect(img.className).toBe('size-full rounded-xl object-cover aspect-square asdf');
|
||||
expect(img.getAttribute('loading')).toBe('eager');
|
||||
expect(img.src).toStrictEqual(expect.any(String));
|
||||
});
|
||||
|
||||
@@ -17,7 +17,7 @@ describe('ShareCover component', () => {
|
||||
const img = component.getByTestId('album-image') as HTMLImageElement;
|
||||
expect(img.alt).toBe('123');
|
||||
expect(img.getAttribute('loading')).toBe('lazy');
|
||||
expect(img.className).toBe('z-0 rounded-xl object-cover aspect-square text');
|
||||
expect(img.className).toBe('size-full rounded-xl object-cover aspect-square text');
|
||||
});
|
||||
|
||||
it('renders an image when the shared link is an individual share', () => {
|
||||
@@ -30,7 +30,7 @@ describe('ShareCover component', () => {
|
||||
const img = component.getByTestId('album-image') as HTMLImageElement;
|
||||
expect(img.alt).toBe('individual_share');
|
||||
expect(img.getAttribute('loading')).toBe('lazy');
|
||||
expect(img.className).toBe('z-0 rounded-xl object-cover aspect-square text');
|
||||
expect(img.className).toBe('size-full rounded-xl object-cover aspect-square text');
|
||||
expect(img.getAttribute('src')).toBe('/asdf');
|
||||
expect(getAssetThumbnailUrl).toHaveBeenCalledWith('someId');
|
||||
});
|
||||
@@ -44,7 +44,7 @@ describe('ShareCover component', () => {
|
||||
const img = component.getByTestId('album-image') as HTMLImageElement;
|
||||
expect(img.alt).toBe('unnamed_share');
|
||||
expect(img.getAttribute('loading')).toBe('lazy');
|
||||
expect(img.className).toBe('z-0 rounded-xl object-cover aspect-square text');
|
||||
expect(img.className).toBe('size-full rounded-xl object-cover aspect-square text');
|
||||
});
|
||||
|
||||
it.skip('renders fallback image when asset is not resized', () => {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<img
|
||||
{alt}
|
||||
on:error={() => (isBroken = true)}
|
||||
class="z-0 rounded-xl object-cover aspect-square {className}"
|
||||
class="size-full rounded-xl object-cover aspect-square {className}"
|
||||
data-testid="album-image"
|
||||
draggable="false"
|
||||
loading={preload ? 'eager' : 'lazy'}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<enhanced:img
|
||||
{alt}
|
||||
class="z-0 rounded-xl object-cover aspect-square {className}"
|
||||
class="size-full rounded-xl object-cover aspect-square {className}"
|
||||
data-testid="album-image"
|
||||
draggable="false"
|
||||
loading={preload ? 'eager' : 'lazy'}
|
||||
|
||||
Reference in New Issue
Block a user