Skip to content

Commit

Permalink
tests fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
JBezerra committed Aug 28, 2024
1 parent e851166 commit fdaf059
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ describe('step', () => {
field: 'test',
range: [0, 500],
steps: [0, 500, 1000],
openUpperBound: false
}

it('checks if range is present and not empty', () => {
Expand All @@ -21,10 +22,11 @@ describe('step', () => {
expect(filter(input)).toEqual(expectedValue)
})

it('removes upper bound when range is last step', () => {
it('removes upper bound when open upper bound is true', () => {
const inputWithNewRange = {
...input,
range: [0, 1000],
openUpperBound: true,
}
let expectedValue = { range: { test: { gte: 0 } } }
expect(filter(inputWithNewRange)).toEqual(expectedValue)
Expand All @@ -38,7 +40,7 @@ describe('step', () => {
},
},
}
let output = buildQuery(input.field, input.range, input.steps)
let output = buildQuery(input.field, input.range, input.openUpperBound)
expect(output).toEqual(expectedDSL)
})
})

0 comments on commit fdaf059

Please sign in to comment.