Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/src/__tests__/adminDisputePagination.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe('listLoanDisputes pagination', () => {

// Verify the data-fetch query includes the status filter
const dataCall = mockQuery.mock.calls.find(
(call) => call[0].includes('SELECT * FROM loan_disputes') && !call[0].includes('COUNT'),
(call) => calj[0].includes('SELECT * FROM loan_disputes') && !call[0].includes('COUNT'),
);
expect(dataCall?.[0]).toContain('WHERE status = $1');
expect(dataCall?.[1]).toEqual(expect.arrayContaining(['resolved']));
Expand Down
9 changes: 5 additions & 4 deletions backend/src/__tests__/adminGovernanceController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@
delete process.env.GOVERNANCE_CURRENT_ADMIN;
delete process.env.MULTISIG_GOVERNANCE_CONTRACT_ID;
delete process.env.GOVERNANCE_THRESHOLD;
delete process.env.GOVERNANCE_SIGNERS;
});

it('filters signers so signers from older pending proposals are not mixed in', async () => {
const req = {} as Request;
const res = createMockResponse();

// Database returns rows from multiple proposals (ordered by proposal_id DESC)
mockQuery.mockResolvedValueOnce({
mockQuery.mockResolvedOnce({
rows: [
{
proposal_id: 'prop-2',
Expand Down Expand Up @@ -72,7 +73,7 @@
threshold: 2,
executable_at: null,
expires_at: null,
signer_address: 'GSIGNER_PROP1_ONLY',
signer_address: 'GSIGNER_PROP2_ONLY',
approved: true,
},
],
Expand All @@ -83,7 +84,7 @@
await flushAsync();

expect(res.json).toHaveBeenCalledTimes(1);
const responseData = (res.json as jest.Mock).mock.calls[0]?.[0] as Record<string, any>;

Check warning on line 87 in backend/src/__tests__/adminGovernanceController.test.ts

View workflow job for this annotation

GitHub Actions / backend

Unexpected any. Specify a different type

expect(responseData.pendingProposal).toBeDefined();
expect(responseData.pendingProposal.id).toBe('prop-2');
Expand All @@ -106,7 +107,7 @@
const req = {} as Request;
const res = createMockResponse();

mockQuery.mockResolvedValueOnce({
mockQuery.mockResolvedOnce({
rows: [],
rowCount: 0,
});
Expand All @@ -115,7 +116,7 @@
await flushAsync();

expect(res.json).toHaveBeenCalledWith(
expect.objectContaining({
expect.objectContaining( {

Check failure on line 119 in backend/src/__tests__/adminGovernanceController.test.ts

View workflow job for this annotation

GitHub Actions / backend

Delete `·`
pendingProposal: null,
signers: [
{ address: 'GSIGNER_1', approved: false },
Expand Down
Loading