Skip to content

Commit

Permalink
fix: enhance test code for new version of get wallet request
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiyuSun committed Jul 21, 2023
1 parent 298c9ae commit 24d9af3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions server/handlers/walletHandler.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ describe('walletRouter', () => {
});

describe('get /wallets', () => {
it('limit parameters missed', async () => {
it('no limit parameter(1000 as default)', async () => {
const res = await request(app).get('/wallets');
expect(res).property('statusCode').eq(422);
expect(res).property('statusCode').eq(200);
expect(res.body.message).match(/limit.*required/);
});

Expand Down
2 changes: 1 addition & 1 deletion server/handlers/walletHandler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const walletGet = async (req, res) => {
await walletGetQuerySchema.validateAsync(req.query, { abortEarly: false });
const walletService = new WalletService();

const { name = '', limit, offset } = req.query;
const { name = '', limit = 1000, offset = 0 } = req.query;
const { wallets, count } = await walletService.getAllWallets(
req.wallet_id,
{
Expand Down

0 comments on commit 24d9af3

Please sign in to comment.