Skip to content

Commit

Permalink
test(common): update ImageKit low quality test (#55193)
Browse files Browse the repository at this point in the history
For commit cd911a8

PR Close #55193
  • Loading branch information
johnnygerard authored and thePunderWoman committed Apr 5, 2024
1 parent 53427d8 commit 80d1094
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/common/test/image_loaders/image_loader_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import {
IMAGE_LOADER,
ImageLoader,
ImageLoaderConfig,
provideNetlifyLoader,
} from '@angular/common/src/directives/ng_optimized_image';
import {provideCloudflareLoader} from '@angular/common/src/directives/ng_optimized_image/image_loaders/cloudflare_loader';
Expand Down Expand Up @@ -171,8 +172,12 @@ describe('Built-in image directive loaders', () => {
it('should load a low quality image when a placeholder is requested', () => {
const path = 'https://ik.imageengine.io/imagetest';
const loader = createImageKitLoader(path);
const config = {src: 'img.png', isPlaceholder: true};
expect(loader(config)).toBe(`${path}/img.png?q=20`);

let config: ImageLoaderConfig = {src: 'img.png', isPlaceholder: true};
expect(loader(config)).toBe(`${path}/tr:q-20/img.png`);

config = {src: 'img.png', isPlaceholder: true, width: 30};
expect(loader(config)).toBe(`${path}/tr:w-30,q-20/img.png`);
});

describe('input validation', () => {
Expand Down

0 comments on commit 80d1094

Please sign in to comment.