Skip to content
This repository was archived by the owner on Jul 26, 2025. It is now read-only.

test: add RGB copyTo test #437

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/operations/__tests__/copyTo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,21 @@ test('negative offset', () => {
expect(result).toMatchImageData([[250]]);
});

test('RGB images', () => {
const target = testUtils.createRgbImage([
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
]);
const source = testUtils.createRgbImage([[3, 3, 3]]);
const result = source.copyTo(target, { origin: { row: 1, column: 0 } });
expect(result).toMatchImageData([
[1, 2, 3],
[3, 3, 3],
[7, 8, 9],
]);
});

test('RGBA images', () => {
const target = testUtils.createRgbaImage([
[1, 2, 3, 255],
Expand Down
Loading