Skip to content

Commit 20261ac

Browse files
wip
1 parent e300f5c commit 20261ac

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

test/unit/operations/indexes.test.ts

+30-3
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,41 @@ describe('makeIndexSpec()', () => {
6262
name: 'sample_index1_-1_sample_index2_1_sample_index3_2d'
6363
},
6464
{
65-
description: 'mixed array of [string, [string, IndexDirection], { [key: string]: IndexDirection }]',
66-
input: ['sample_index1', ['sample_index2', -1], { sample_index3: '2d' }],
65+
description:
66+
'mixed array of [string, [string, IndexDirection], { [key: string]: IndexDirection }, Map<string, IndexDirection>]',
67+
input: [
68+
'sample_index1',
69+
['sample_index2', -1],
70+
{ sample_index3: '2d' },
71+
new Map<string, IndexDirection>([['sample_index4', '2dsphere']])
72+
],
73+
mapData: new Map<string, IndexDirection>([
74+
['sample_index1', 1],
75+
['sample_index2', -1],
76+
['sample_index3', '2d'],
77+
['sample_index4', '2dsphere']
78+
]),
79+
name: 'sample_index1_1_sample_index2_-1_sample_index3_2d_sample_index4_2dsphere'
80+
},
81+
{
82+
description: 'array of Map<string, IndexDirection>',
83+
input: [
84+
new Map<string, IndexDirection>([['sample_index1', 1]]),
85+
new Map<string, IndexDirection>([['sample_index2', -1]]),
86+
new Map<string, IndexDirection>([['sample_index3', '2d']])
87+
],
6788
mapData: new Map<string, IndexDirection>([
6889
['sample_index1', 1],
6990
['sample_index2', -1],
7091
['sample_index3', '2d']
7192
]),
7293
name: 'sample_index1_1_sample_index2_-1_sample_index3_2d'
94+
},
95+
{
96+
description: 'single Map<string, IndexDirection>',
97+
input: new Map<string, IndexDirection>([['sample_index', -1]]),
98+
mapData: new Map<string, IndexDirection>([['sample_index', -1]]),
99+
name: 'sample_index_-1'
73100
}
74101
];
75102

@@ -82,7 +109,7 @@ describe('makeIndexSpec()', () => {
82109
expect(realOutput.indexes[0].key).to.deep.equal(mapData);
83110
});
84111

85-
it(`should set name to null if none provided with ${description} input `, () => {
112+
it(`should set name correctly if none provided with ${description} input `, () => {
86113
const realOutput = makeIndexOperation(input);
87114
expect(realOutput.indexes[0].name).to.equal(name);
88115
});

0 commit comments

Comments
 (0)