Skip to content

Commit b951fe6

Browse files
committed
test: pass limit query param in limit-only unpaginated test
The test claimed to verify that a bare `?limit=10` request (no `page`) is handled as unpaginated, but the body sent no query parameters at all, making it indistinguishable from the earlier "no query params" test. Bugbot flagged that a future regression where `isPaginated` also triggered on `limit` would slip past this guard. Send the intended query parameter so the test verifies its namesake.
1 parent 88ce363 commit b951fe6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/resources/staging.spec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,14 @@ describe('Staging Resource CRUD', function () {
184184
.stub(Staging, 'getDiffObjects')
185185
.resolves([{ original: { warehouseUnitId: 'unit-1' }, change: {} }]);
186186

187-
const response = await supertest(app).get('/v1/staging').expect(200);
187+
const response = await supertest(app)
188+
.get('/v1/staging')
189+
.query({ limit: 10 })
190+
.expect(200);
188191

189192
expect(findAllStub.calledOnce).to.be.true;
190193
expect(findAndCountAllStub.called).to.be.false;
194+
expect(getDiffObjectsStub.calledOnce).to.be.true;
191195
expect(findAllStub.firstCall.args[0]).to.deep.equal({
192196
where: {},
193197
order: [['id', 'ASC']],

0 commit comments

Comments
 (0)