Skip to content

Commit 63ae965

Browse files
committed
Added tests for modifyRows module
1 parent 93079c5 commit 63ae965

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

tests/utils/modifyRows.test.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { modifyRows } from '../../src/utils/modifyRows';
2+
3+
it('Should work', () => {
4+
const rows = modifyRows(
5+
{
6+
block: {
7+
block_1: {
8+
role: 'editor',
9+
value: {
10+
properties: {
11+
title: [['A']]
12+
}
13+
} as any
14+
},
15+
block_2: {
16+
role: 'editor',
17+
value: {
18+
properties: {
19+
title: [['C']]
20+
}
21+
} as any
22+
},
23+
block_3: {
24+
role: 'editor',
25+
value: {
26+
properties: {
27+
title: [['B']]
28+
}
29+
} as any
30+
}
31+
}
32+
},
33+
'block_4'
34+
);
35+
expect(rows).toStrictEqual([
36+
{
37+
properties: {
38+
title: [['A']]
39+
}
40+
},
41+
{
42+
properties: {
43+
title: [['B']]
44+
}
45+
},
46+
{
47+
properties: {
48+
title: [['C']]
49+
}
50+
}
51+
]);
52+
});

0 commit comments

Comments
 (0)