|
1 | 1 | import { expect } from 'chai';
|
2 | 2 | import sinon from 'sinon';
|
3 | 3 |
|
4 |
| -import { createIndex, createName } from '../create-index'; |
| 4 | +import { createIndex } from '../create-index'; |
5 | 5 | import { HANDLE_ERROR, CLEAR_ERROR } from '../error';
|
6 | 6 | import { TOGGLE_IN_PROGRESS } from '../in-progress';
|
7 | 7 | import { TOGGLE_IS_VISIBLE } from '../is-visible';
|
@@ -148,7 +148,7 @@ describe('create index is background module', function () {
|
148 | 148 | );
|
149 | 149 | expect(errorSpy.calledOnce).to.equal(false, 'error should not be called');
|
150 | 150 | });
|
151 |
| - it('generates name if empty', function () { |
| 151 | + it('does not generate name if empty', function () { |
152 | 152 | const dispatch = (res) => {
|
153 | 153 | if (typeof res !== 'function') {
|
154 | 154 | switch (res.type) {
|
@@ -195,7 +195,6 @@ describe('create index is background module', function () {
|
195 | 195 | background: true,
|
196 | 196 | collation: 'coll',
|
197 | 197 | expireAfterSeconds: 100,
|
198 |
| - name: 'abc_1', |
199 | 198 | partialFilterExpression: { a: 1 },
|
200 | 199 | unique: true,
|
201 | 200 | });
|
@@ -266,24 +265,4 @@ describe('create index is background module', function () {
|
266 | 265 | expect(errorSpy.calledOnce).to.equal(true, 'error should be called');
|
267 | 266 | });
|
268 | 267 | });
|
269 |
| - |
270 |
| - describe('#createName', function () { |
271 |
| - context('when the index is not a wildcard index', function () { |
272 |
| - const fields = [{ name: 'name' }, { name: 'age' }]; |
273 |
| - const spec = { name: 1, age: -1 }; |
274 |
| - it('generates a name with all fields and directions', function () { |
275 |
| - expect(createName(fields, spec)).to.equal('name_1_age_-1'); |
276 |
| - }); |
277 |
| - }); |
278 |
| - |
279 |
| - context('when the index is a wildcard', function () { |
280 |
| - const fields = [{ name: 'name' }, { name: 'age' }]; |
281 |
| - const spec = { name: '$**name.first', age: '$**age.years' }; |
282 |
| - it('generates a name with all fields and wilcard replacement', function () { |
283 |
| - expect(createName(fields, spec)).to.equal( |
284 |
| - 'name_wildcardname.first_age_wildcardage.years' |
285 |
| - ); |
286 |
| - }); |
287 |
| - }); |
288 |
| - }); |
289 | 268 | });
|
0 commit comments