fix: work through how i want to return the api response with the data property being of the right type.

This commit is contained in:
StevanFreeborn
2023-02-01 21:21:39 -06:00
parent 5a6c5094e9
commit 4952bf30ec
9 changed files with 164 additions and 39 deletions
+4 -3
View File
@@ -11,17 +11,18 @@ describe('PagedResponse', function () {
});
it('should have 4 parameters', function () {
expect(PagedResponse).to.have.lengthOf(4);
expect(PagedResponse).to.have.lengthOf(5);
});
it('should construct a new instance of PagedResponse', function () {
const pagedResponse = new PagedResponse<number>([1, 2, 3, 4], 1, 10, 100);
const pagedResponse = new PagedResponse<number>([1, 2, 3, 4], 1, 10, 100, 100);
expect(pagedResponse).to.not.be.undefined;
expect(pagedResponse).to.be.instanceOf(PagedResponse);
expect(pagedResponse).to.have.property('items').to.be.an('array').to.have.lengthOf(4);
expect(pagedResponse).to.have.property('pageNumber').to.be.a('number').to.equal(1);
expect(pagedResponse).to.have.property('pageSize').to.be.a('number').to.equal(10);
expect(pagedResponse).to.have.property('totalCount').to.be.a('number').to.equal(100);
expect(pagedResponse).to.have.property('totalPages').to.be.a('number').to.equal(100);
expect(pagedResponse).to.have.property('totalRecords').to.be.a('number').to.equal(100);
});
});