Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
gabaldon committed Nov 25, 2021
1 parent 8de7bf1 commit e14466e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
6 changes: 2 additions & 4 deletions packages/api/src/repository/Feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class FeedRepository {
)[0]
return {
feeds: aggregation.feeds.map(this.normalizeId),
total: aggregation.total[0].count
total: aggregation.total[0]?.count
}
}

Expand All @@ -92,9 +92,7 @@ export class FeedRepository {
then: 1,
else: {
$cond: {
if: {
$regexMatch: { input: '$network', regex: /ethereum/i }
},
if: { $eq: [{ $substr: ['$network', 0, 8] }, 'ethereum'] },
then: 2,
else: 3
}
Expand Down
9 changes: 3 additions & 6 deletions packages/api/test/feeds.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,17 @@ describe('feeds', function () {
}
}
`
const {
data: {
feeds: { feeds }
}
} = await state.testClient.query({
const feeds = await state.testClient.query({
query: GET_FEEDS,
variables: {
page: 1,
pageSize: 6,
network: 'all'
}
})
console.log('data---->', feeds)

expect(feeds.length).toBe(0)
expect(feeds.data?.feeds.length).toBe(0)
})

it('get feed list with data feeds', async () => {
Expand Down

0 comments on commit e14466e

Please sign in to comment.