Skip to content

Commit

Permalink
add tests"
Browse files Browse the repository at this point in the history
git push
`
`
  • Loading branch information
cbaker6 committed Jun 5, 2023
1 parent 7c79c33 commit 4cd4e22
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions spec/QueryTools.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,35 @@ describe('matchesQuery', function () {
expect(matchesQuery(obj, q)).toBe(false);
});

it('matches queries with eq constraint', function () {
const obj = {
objectId: 'Person2',
score: 12,
name: 'Tom',
};

const q1 = {
objectId: {
$eq: 'Person2',
},
};

const q2 = {
score: {
$eq: 12,
},
};

const q3 = {
name: {
$eq: 'Tom',
},
};
expect(matchesQuery(obj, q1)).toBe(true);
expect(matchesQuery(obj, q2)).toBe(true);
expect(matchesQuery(obj, q3)).toBe(true);
});

it('matches on equality queries', function () {
const day = new Date();
const location = new Parse.GeoPoint({
Expand Down

0 comments on commit 4cd4e22

Please sign in to comment.