1
1
import {
2
- constructDimensionsNameMap ,
3
- constructMeasuresNameMap ,
4
2
createBaseTableSchema ,
5
3
generateResolutionJoinPaths ,
6
4
generateResolutionSchemas ,
@@ -37,10 +35,6 @@ describe('Create base table schema', () => {
37
35
] ,
38
36
} ,
39
37
] ;
40
- const columnNameMap = {
41
- ...constructMeasuresNameMap ( tableSchemas ) ,
42
- ...constructDimensionsNameMap ( tableSchemas ) ,
43
- } ;
44
38
const resolutionConfig : ResolutionConfig = {
45
39
columnConfigs : [ ] ,
46
40
tableSchemas : [ ] ,
@@ -50,7 +44,7 @@ describe('Create base table schema', () => {
50
44
51
45
const baseTableSchema = createBaseTableSchema (
52
46
sql ,
53
- columnNameMap ,
47
+ tableSchemas ,
54
48
resolutionConfig ,
55
49
measures ,
56
50
dimensions
@@ -105,7 +99,6 @@ describe('Create base table schema', () => {
105
99
] ,
106
100
} ,
107
101
] ;
108
- const columnNameMap = constructDimensionsNameMap ( tableSchemas ) ;
109
102
const resolutionConfig = {
110
103
columnConfigs : [
111
104
{
@@ -127,7 +120,7 @@ describe('Create base table schema', () => {
127
120
128
121
const baseTableSchema = createBaseTableSchema (
129
122
sql ,
130
- columnNameMap ,
123
+ tableSchemas ,
131
124
resolutionConfig ,
132
125
[ ] ,
133
126
dimensions
@@ -178,7 +171,6 @@ describe('Create base table schema', () => {
178
171
] ,
179
172
} ,
180
173
] ;
181
- const columnNameMap = constructDimensionsNameMap ( tableSchemas ) ;
182
174
const resolutionConfig = {
183
175
columnConfigs : [ ] ,
184
176
tableSchemas : [ ] ,
@@ -188,7 +180,7 @@ describe('Create base table schema', () => {
188
180
expect ( ( ) => {
189
181
createBaseTableSchema (
190
182
sql ,
191
- columnNameMap ,
183
+ tableSchemas ,
192
184
resolutionConfig ,
193
185
[ ] ,
194
186
dimensions
@@ -219,7 +211,6 @@ describe('Create base table schema', () => {
219
211
] ,
220
212
} ,
221
213
] ;
222
- const columnNameMap = constructDimensionsNameMap ( tableSchemas ) ;
223
214
const resolutionConfig = {
224
215
columnConfigs : [
225
216
{
@@ -241,7 +232,7 @@ describe('Create base table schema', () => {
241
232
242
233
const baseTableSchema = createBaseTableSchema (
243
234
sql ,
244
- columnNameMap ,
235
+ tableSchemas ,
245
236
resolutionConfig ,
246
237
[ ] ,
247
238
dimensions
@@ -298,7 +289,6 @@ describe('Generate resolution schemas', () => {
298
289
] ,
299
290
} ,
300
291
] ;
301
- const columnNameMap = constructDimensionsNameMap ( baseTableSchemas ) ;
302
292
303
293
const resolutionConfig = {
304
294
columnConfigs : [
@@ -341,7 +331,10 @@ describe('Generate resolution schemas', () => {
341
331
] ,
342
332
} ;
343
333
344
- const schemas = generateResolutionSchemas ( resolutionConfig , columnNameMap ) ;
334
+ const schemas = generateResolutionSchemas (
335
+ resolutionConfig ,
336
+ baseTableSchemas
337
+ ) ;
345
338
346
339
expect ( schemas ) . toEqual ( [
347
340
{
@@ -422,7 +415,7 @@ describe('Generate resolution schemas', () => {
422
415
} ;
423
416
424
417
expect ( ( ) => {
425
- generateResolutionSchemas ( resolutionConfig , { } ) ;
418
+ generateResolutionSchemas ( resolutionConfig , [ ] ) ;
426
419
} ) . toThrow ( 'Table schema not found for resolution_table1' ) ;
427
420
} ) ;
428
421
@@ -459,7 +452,7 @@ describe('Generate resolution schemas', () => {
459
452
} ;
460
453
461
454
expect ( ( ) => {
462
- generateResolutionSchemas ( resolutionConfig , { } ) ;
455
+ generateResolutionSchemas ( resolutionConfig , [ ] ) ;
463
456
} ) . toThrow ( 'Dimension not found: display_id' ) ;
464
457
} ) ;
465
458
@@ -494,7 +487,7 @@ describe('Generate resolution schemas', () => {
494
487
] ,
495
488
} ;
496
489
497
- const schemas = generateResolutionSchemas ( resolutionConfig , { } ) ;
490
+ const schemas = generateResolutionSchemas ( resolutionConfig , [ ] ) ;
498
491
expect ( schemas ) . toEqual ( [
499
492
{
500
493
name : 'base_table__column1' ,
@@ -528,7 +521,6 @@ describe('Generate resolution schemas', () => {
528
521
] ,
529
522
} ,
530
523
] ;
531
- const columnNameMap = constructDimensionsNameMap ( baseTableSchemas ) ;
532
524
533
525
const resolutionConfig = {
534
526
columnConfigs : [
@@ -562,7 +554,10 @@ describe('Generate resolution schemas', () => {
562
554
] ,
563
555
} ;
564
556
565
- const schemas = generateResolutionSchemas ( resolutionConfig , columnNameMap ) ;
557
+ const schemas = generateResolutionSchemas (
558
+ resolutionConfig ,
559
+ baseTableSchemas
560
+ ) ;
566
561
expect ( schemas ) . toEqual ( [
567
562
{
568
563
name : 'base_table__column1' ,
@@ -665,7 +660,7 @@ describe('Generate resolution join paths', () => {
665
660
tableSchemas : [ ] ,
666
661
} ;
667
662
668
- const joinPaths = generateResolutionJoinPaths ( resolutionConfig , { } ) ;
663
+ const joinPaths = generateResolutionJoinPaths ( resolutionConfig , [ ] ) ;
669
664
670
665
expect ( joinPaths ) . toEqual ( [
671
666
[
@@ -707,7 +702,6 @@ describe('Generate resolution join paths', () => {
707
702
] ,
708
703
} ,
709
704
] ;
710
- const columnNameMap = constructDimensionsNameMap ( baseTableSchemas ) ;
711
705
712
706
const resolutionConfig = {
713
707
columnConfigs : [
@@ -723,7 +717,7 @@ describe('Generate resolution join paths', () => {
723
717
724
718
const joinPaths = generateResolutionJoinPaths (
725
719
resolutionConfig ,
726
- columnNameMap
720
+ baseTableSchemas
727
721
) ;
728
722
expect ( joinPaths ) . toEqual ( [
729
723
[
0 commit comments