From f696d897f7b931b04b4f13231139006c07177404 Mon Sep 17 00:00:00 2001 From: Agnes Lin Date: Fri, 10 Jul 2020 12:39:21 -0400 Subject: [PATCH] fix --- test/mongodb.test.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/test/mongodb.test.js b/test/mongodb.test.js index 243005147..9edab5334 100644 --- a/test/mongodb.test.js +++ b/test/mongodb.test.js @@ -3728,24 +3728,26 @@ describe('mongodb connector', function() { }); context('trimLeadingDollarSigns', () =>{ - it('removes extra dollar sign(s) in ths operators', () => { - let spec = '$eq'; - let updatedSpec = trimLeadingDollarSigns(spec); + it('removes an extra leading dollar sign in ths operators', () => { + const spec = '$eq'; + const updatedSpec = trimLeadingDollarSigns(spec); updatedSpec.should.equal('eq'); - - spec = '$$eq'; - updatedSpec = trimLeadingDollarSigns(spec); + }); + it('removes extra leading dollar signs in ths operators', () => { + const spec = '$$eq'; + const updatedSpec = trimLeadingDollarSigns(spec); updatedSpec.should.equal('eq'); }); - it('remains the same if there is the input does not start with dollar sign(s)', () => { - let spec = 'eq'; - let updatedSpec = trimLeadingDollarSigns(spec); + it('remains the same if the input does not contain any dollar signs', () => { + const spec = 'eq'; + const updatedSpec = trimLeadingDollarSigns(spec); updatedSpec.should.equal(spec); - - spec = 'eq$'; - updatedSpec = trimLeadingDollarSigns(spec); - updatedSpec.should.equal('eq$'); + }); + it('remains the same if the input does not start with dollar signs', () => { + const spec = 'eq$'; + const updatedSpec = trimLeadingDollarSigns(spec); + updatedSpec.should.equal(spec); }); }); context('sanitizeFilter()', () => {