Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Agnes Lin committed Jul 10, 2020
1 parent ad96e63 commit f696d89
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions test/mongodb.test.js
Expand Up @@ -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()', () => {
Expand Down

0 comments on commit f696d89

Please sign in to comment.