Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
josemarinas committed Jul 19, 2023
1 parent 82705e0 commit 049a362
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/client/src/client-common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function computeProposalStatusFilter(
where = { startDate_gte: now, potentiallyExecutable: false, executed: false };
break;
case ProposalStatus.ACTIVE:
where = { startDate_lt: now, endDate_gte: now, executed: false, potentiallyExecutable: false };
where = { startDate_lt: now, endDate_gte: now, executed: false };
break;
case ProposalStatus.EXECUTED:
where = { executed: true };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ describe("Client Address List", () => {
where: {
endDate_lt: nowFilter,
executed: false,
potentiallyExecutable: false,
},
skip: 0,
limit: params.limit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ describe("Client Multisig", () => {
where: {
endDate_lt: nowFilter,
executed: false,
potentiallyExecutable: false,
},
skip: 0,
limit: params.limit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,7 @@ describe("Token Voting Client", () => {
where: {
endDate_lt: nowFilter,
executed: false,
potentiallyExecutable: false,
},
skip: 0,
limit: params.limit,
Expand Down
4 changes: 2 additions & 2 deletions modules/client/test/unit/client-common/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe("client-common utils", () => {
})).toBe(ProposalStatus.ACTIVE);
});
it("should return SUCCEDED if executable = true", () => {
const endDate = Date.now() / 1000;
const endDate = (Date.now() / 1000) - 300;
const startDate = (Date.now() / 1000) - 500;

expect(computeProposalStatus({
Expand All @@ -113,7 +113,7 @@ describe("client-common utils", () => {
expect(computeProposalStatus({
endDate: endDate.toString(),
startDate: startDate.toString(),
potentiallyExecutable: false,
potentiallyExecutable: true,
executed: false,
earlyExecutable: true,
})).toBe(ProposalStatus.SUCCEEDED);
Expand Down

0 comments on commit 049a362

Please sign in to comment.