Skip to content

Commit

Permalink
refactor url in integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
vinit717 committed Aug 4, 2023
1 parent 70eb65b commit 940194b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/integration/tasks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,11 @@ describe("Tasks", function () {
const searchTerm = "task";
chai
.request(app)
.get(`/tasks?q=searchTerm:"${encodeURIComponent(searchTerm)}"`)
.get("/tasks?q=searchTerm:task")
.end((err, res) => {
if (err) {
return done(err);
}

expect(res).to.have.status(200);
expect(res.body).to.be.a("object");
expect(res.body.message).to.equal("Filter tasks returned successfully!");
Expand All @@ -285,10 +284,9 @@ describe("Tasks", function () {
});
});
it("Should get tasks filtered by search term and handle no tasks found", function (done) {
const searchTerm = " ";
chai
.request(app)
.get(`/tasks?q=searchTerm:"${encodeURIComponent(searchTerm)}"`)
.get(`/tasks?q=searchTerm:random1`)
.end((err, res) => {
if (err) {
return done(err);
Expand Down

0 comments on commit 940194b

Please sign in to comment.