Skip to content

Commit c6e129d

Browse files
committed
chore: add tests
1 parent 9a6a898 commit c6e129d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

packages/cubejs-schema-compiler/test/unit/__snapshots__/schema.test.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,6 +1446,7 @@ Object {
14461446
},
14471447
"evaluatedHierarchies": Array [
14481448
Object {
1449+
"aliasMember": "orders.hello",
14491450
"levels": Array [
14501451
"orders_view.my_beloved_status",
14511452
],

packages/cubejs-schema-compiler/test/unit/hierarchies.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ describe('Cube hierarchies', () => {
2323
name: 'orders_users_view.orders_hierarchy',
2424
title: 'Hello Hierarchy',
2525
public: true,
26+
aliasMember: 'orders.orders_hierarchy',
2627
levels: [
2728
'orders_users_view.status',
2829
'orders_users_view.number',
@@ -32,6 +33,7 @@ describe('Cube hierarchies', () => {
3233
{
3334
name: 'orders_users_view.some_other_hierarchy',
3435
public: true,
36+
aliasMember: 'orders.some_other_hierarchy',
3537
title: 'Some other hierarchy',
3638
levels: ['orders_users_view.state', 'orders_users_view.user_city']
3739
}
@@ -54,6 +56,7 @@ describe('Cube hierarchies', () => {
5456

5557
const prefixedHierarchy = allHierarchyView.config.hierarchies.find((it) => it.name === 'all_hierarchy_view.users_users_hierarchy');
5658
expect(prefixedHierarchy).toBeTruthy();
59+
expect(prefixedHierarchy?.aliasMember).toEqual('users.users_hierarchy');
5760
expect(prefixedHierarchy?.levels).toEqual(['all_hierarchy_view.users_age', 'all_hierarchy_view.users_city']);
5861
});
5962

@@ -146,12 +149,14 @@ describe('Cube hierarchies', () => {
146149

147150
expect(testView?.config.hierarchies).toEqual([
148151
{
152+
aliasMember: 'orders.base_orders_hierarchy',
149153
name: 'test_view.base_orders_hierarchy',
150154
title: 'Hello Hierarchy',
151155
levels: ['test_view.status', 'test_view.number'],
152156
public: true
153157
},
154158
{
159+
aliasMember: 'orders.orders_hierarchy',
155160
name: 'test_view.orders_hierarchy',
156161
levels: ['test_view.state', 'test_view.city'],
157162
public: true
@@ -174,6 +179,7 @@ describe('Cube hierarchies', () => {
174179

175180
expect(ordersCube.config.hierarchies).toEqual([
176181
{
182+
aliasMember: undefined,
177183
name: 'orders.hello',
178184
title: 'World',
179185
levels: ['orders.status'],

0 commit comments

Comments
 (0)