Skip to content

Commit 92adbc1

Browse files
committed
[tests] 100%
1 parent b1f2e60 commit 92adbc1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/unit/core/other/middleware.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,16 @@ describe('willSetRow', () => {
10821082
expect(store.getRow('t1', 'r1')).toEqual({c1: 'a'});
10831083
});
10841084

1085+
test('omitting existing cellId from returned row deletes it', () => {
1086+
store.setRow('t1', 'r1', {c1: 'a', c2: 'b'});
1087+
middleware.addWillSetRowCallback((_tableId, _rowId, row) => {
1088+
const {c2: _, ...rest} = row;
1089+
return rest;
1090+
});
1091+
store.setCell('t1', 'r1', 'c3', 'c');
1092+
expect(store.getRow('t1', 'r1')).toEqual({c1: 'a', c3: 'c'});
1093+
});
1094+
10851095
test('not called from setPartialRow', () => {
10861096
const calls: string[] = [];
10871097
middleware.addWillSetRowCallback((tableId, rowId, row) => {

0 commit comments

Comments
 (0)