Skip to content

Commit

Permalink
Fix Zerion getCollectibles items count attribute (#1193)
Browse files Browse the repository at this point in the history
- Set the `count` attribute to `null` on Zerion's collectibles retrieval.
- Adapt the associated tests.
  • Loading branch information
hectorgomezv authored Feb 22, 2024
1 parent 7ca6203 commit 9194172
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/datasources/balances-api/zerion-balances-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ export class ZerionBalancesApi implements IBalancesApi {
expireTimeSeconds: this.defaultExpirationTimeInSeconds,
});

// TODO: Zerion does not provide the items count. Change this value to null when count attribute becomes nullable.
// Zerion does not provide the items count.
// Zerion does not provide a "previous" cursor.
return {
count: zerionCollectibles.data.length,
count: null,
next: this._decodeZerionPagination(zerionCollectibles.links.next ?? ''),
previous: null,
results: this._mapCollectibles(zerionCollectibles.data),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe('Zerion Collectibles Controller', () => {
.expect(200)
.expect(({ body }) => {
expect(body).toMatchObject({
count: zerionApiCollectiblesResponse.data.length,
count: null,
next: expect.any(String),
previous: null,
results: [
Expand Down Expand Up @@ -282,7 +282,7 @@ describe('Zerion Collectibles Controller', () => {
.expect(200)
.expect(({ body }) => {
expect(body).toMatchObject({
count: zerionApiCollectiblesResponse.data.length,
count: null,
next: expect.stringContaining(expectedNext),
previous: null,
results: expect.any(Array),
Expand Down Expand Up @@ -345,7 +345,7 @@ describe('Zerion Collectibles Controller', () => {
.expect(200)
.expect(({ body }) => {
expect(body).toMatchObject({
count: zerionApiCollectiblesResponse.data.length,
count: null,
next: expect.stringContaining(expectedNext),
previous: null,
results: expect.any(Array),
Expand Down Expand Up @@ -407,7 +407,7 @@ describe('Zerion Collectibles Controller', () => {
.expect(200)
.expect(({ body }) => {
expect(body).toMatchObject({
count: zerionApiCollectiblesResponse.data.length,
count: null,
next: expect.stringContaining(expectedNext),
previous: null,
results: expect.any(Array),
Expand Down

0 comments on commit 9194172

Please sign in to comment.