Skip to content

Commit f8efb14

Browse files
committed
Added a regression test
1 parent 23cf94e commit f8efb14

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

packages/cubejs-client-core/test/ResultSet.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,5 +1807,28 @@ describe('ResultSet', () => {
18071807
]
18081808
);
18091809
});
1810+
1811+
test('keeps null values on non-matching rows', () => {
1812+
const resultSet = new ResultSet({
1813+
query: {
1814+
dimensions: [
1815+
'User.name',
1816+
'Friend.name'
1817+
],
1818+
},
1819+
data: [
1820+
{
1821+
'User.name': 'Bob',
1822+
'Friend.name': null,
1823+
}
1824+
],
1825+
} as any);
1826+
1827+
expect(resultSet.tablePivot()).toEqual(
1828+
[
1829+
{ 'User.name': 'Alice', 'Friend.name': null },
1830+
]
1831+
);
1832+
});
18101833
});
18111834
});

0 commit comments

Comments
 (0)