Skip to content

Commit bd5cc06

Browse files
authored
test: add RGB copyTo test (#437)
1 parent 3a8833a commit bd5cc06

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/operations/__tests__/copyTo.test.ts

+15
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,21 @@ test('negative offset', () => {
9999
expect(result).toMatchImageData([[250]]);
100100
});
101101

102+
test('RGB images', () => {
103+
const target = testUtils.createRgbImage([
104+
[1, 2, 3],
105+
[4, 5, 6],
106+
[7, 8, 9],
107+
]);
108+
const source = testUtils.createRgbImage([[3, 3, 3]]);
109+
const result = source.copyTo(target, { origin: { row: 1, column: 0 } });
110+
expect(result).toMatchImageData([
111+
[1, 2, 3],
112+
[3, 3, 3],
113+
[7, 8, 9],
114+
]);
115+
});
116+
102117
test('RGBA images', () => {
103118
const target = testUtils.createRgbaImage([
104119
[1, 2, 3, 255],

0 commit comments

Comments
 (0)