Skip to content

Commit

Permalink
Add jest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
crayolakat committed Mar 6, 2024
1 parent bfee000 commit f9d00b7
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions __test__/server/api/assignment.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,29 @@ describe("test getContacts timezone stuff only", () => {
/^select \* from .campaign_contact. where .assignment_id. = 1.*/
);
}); // it

it("returns the correct query -- assignment load limit not set", () => {
let query = getContacts(
assignment,
{ validTimezone: null },
organization,
campaign
);
expect(query.toString()).not.toMatch(
/^select \* from .campaign_contact. where .assignment_id. = 1.* limit 1/
);
}); // it

it("returns the correct query -- assignment load limit set", () => {
global["ASSIGNMENT_LOAD_LIMIT"] = 1;
let query = getContacts(
assignment,
{ validTimezone: null },
organization,
campaign
);
expect(query.toString()).toMatch(
/^select \* from .campaign_contact. where .assignment_id. = 1.* limit 1/
);
}); // it
}); // describe

0 comments on commit f9d00b7

Please sign in to comment.