Skip to content

Commit

Permalink
Added extra unit test to verify that the color space is changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Dec 5, 2024
1 parent e49d26c commit 07b86b4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/magick-image/transform-color-space.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Licensed under the Apache License, Version 2.0.
*/

import { ColorSpace } from '@src/enums/color-space';
import { TestFiles } from '@test/test-files';

describe('MagickImage#transformColorSpace', () => {
Expand Down Expand Up @@ -39,4 +40,16 @@ describe('MagickImage#transformColorSpace', () => {
expect(result).toBe(true);
});
});

it('should change the colorspace of the image', () => {
TestFiles.Images.imageMagickJpg.use((image) => {
expect(image.colorSpace).toBe(ColorSpace.sRGB);

const source = TestFiles.Profiles.Color.SRGB.load();
const target = TestFiles.Profiles.Color.USWebCoatedSWOP.load();
const result = image.transformColorSpace(source, target);
expect(result).toBe(true);
expect(image.colorSpace).toBe(ColorSpace.CMYK);
});
});
});

0 comments on commit 07b86b4

Please sign in to comment.