Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdev22 committed Nov 16, 2023
1 parent d99b859 commit 2ca2a73
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
56 changes: 28 additions & 28 deletions graph/rewards_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_FwdPaginate() {
"totalCount": 1,
"edges": [
{
"cursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"cursor": "kgIA",
"node": {
"week": 2,
"beneficiary": "%s",
Expand Down Expand Up @@ -240,10 +240,10 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_FwdPaginate() {
}
],
"pageInfo": {
"endCursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"endCursor": "kgIA",
"hasNextPage": false,
"hasPreviousPage": false,
"startCursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
"startCursor": "kgIA"
}
}
}
Expand Down Expand Up @@ -320,7 +320,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_FwdPaginate_Firs
id
earnings {
totalTokens
history(first: 3, after: "kwQAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=") {
history(first: 3, after: "kgQA") {
totalCount
edges {
cursor
Expand Down Expand Up @@ -384,7 +384,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_FwdPaginate_Firs
"totalCount": 3,
"edges": [
{
"cursor": "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"cursor": "kgMA",
"node": {
"week": 3,
"beneficiary": "%s",
Expand All @@ -408,7 +408,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_FwdPaginate_Firs
}
},
{
"cursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"cursor": "kgIA",
"node": {
"week": 2,
"beneficiary": "%s",
Expand Down Expand Up @@ -445,10 +445,10 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_FwdPaginate_Firs
}
],
"pageInfo": {
"endCursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"endCursor": "kgIA",
"hasNextPage": false,
"hasPreviousPage": true,
"startCursor": "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
"startCursor": "kgMA"
}
}
}
Expand Down Expand Up @@ -589,7 +589,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_BackPaginate_Las
"totalCount": 3,
"edges": [
{
"cursor": "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"cursor": "kgMA",
"node": {
"week": 3,
"beneficiary": "%s",
Expand All @@ -613,7 +613,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_BackPaginate_Las
}
},
{
"cursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"cursor": "kgIA",
"node": {
"week": 2,
"beneficiary": "%s",
Expand Down Expand Up @@ -650,10 +650,10 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_BackPaginate_Las
}
],
"pageInfo": {
"endCursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"endCursor": "kgIA",
"hasNextPage": false,
"hasPreviousPage": true,
"startCursor": "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
"startCursor": "kgMA"
}
}
}
Expand Down Expand Up @@ -730,7 +730,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_BackPaginate_Las
id
earnings {
totalTokens
history(last: 2, before: "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=") {
history(last: 2, before: "kgIA") {
totalCount
edges {
cursor
Expand Down Expand Up @@ -794,7 +794,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_BackPaginate_Las
"totalCount": 3,
"edges": [
{
"cursor": "kwQAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"cursor": "kgQA",
"node": {
"week": 4,
"beneficiary": "%s",
Expand All @@ -818,7 +818,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_BackPaginate_Las
}
},
{
"cursor": "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"cursor": "kgMA",
"node": {
"week": 3,
"beneficiary": "%s",
Expand Down Expand Up @@ -855,10 +855,10 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_BackPaginate_Las
}
],
"pageInfo": {
"endCursor": "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"endCursor": "kgMA",
"hasNextPage": true,
"hasPreviousPage": false,
"startCursor": "kwQAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
"startCursor": "kgQA"
}
}
}
Expand Down Expand Up @@ -962,10 +962,10 @@ func (r *RewardsQueryTestSuite) Test_Query_GetAftermarketDeviceEarnings_FwdPagin
"history": {
"totalCount": 1,
"pageInfo": {
"endCursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"endCursor": "kgIA",
"hasNextPage": false,
"hasPreviousPage": false,
"startCursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
"startCursor": "kgIA"
},
"edges": [
{
Expand All @@ -974,7 +974,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetAftermarketDeviceEarnings_FwdPagin
"beneficiary": "%s",
"connectionStreak": 20
},
"cursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
"cursor": "kgIA"
}
]
}
Expand Down Expand Up @@ -1124,7 +1124,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetUserRewards_FwdPaginate() {
"tokenId": 1
}
},
"cursor": "kwQAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
"cursor": "kgQA"
},
{
"node": {
Expand All @@ -1145,12 +1145,12 @@ func (r *RewardsQueryTestSuite) Test_Query_GetUserRewards_FwdPaginate() {
"tokenId": 1
}
},
"cursor": "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
"cursor": "kgMA"
}
],
"pageInfo": {
"startCursor": "kwQAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"endCursor": "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"startCursor": "kgQA",
"endCursor": "kgMA",
"hasPreviousPage": false,
"hasNextPage": true
}
Expand Down Expand Up @@ -1297,7 +1297,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetUserRewards_BackPaginate_LastBefor
"tokenId": 1
}
},
"cursor": "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
"cursor": "kgMA"
},
{
"node": {
Expand All @@ -1318,12 +1318,12 @@ func (r *RewardsQueryTestSuite) Test_Query_GetUserRewards_BackPaginate_LastBefor
"tokenId": 1
}
},
"cursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
"cursor": "kgIA"
}
],
"pageInfo": {
"startCursor": "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"endCursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=",
"startCursor": "kgMA",
"endCursor": "kgIA",
"hasPreviousPage": true,
"hasNextPage": false
}
Expand Down
14 changes: 7 additions & 7 deletions internal/repositories/rewards_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ func (r *RewardsRepoTestSuite) Test_PaginateVehicleEarningsByID_FwdPagination_Fi
r.NoError(err)

first := 2
after := "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
after := "kgMA"
paginatedEarnings, err := r.repo.PaginateVehicleEarningsByID(r.ctx, rwrd, &first, &after, nil, nil)
r.NoError(err)

Expand Down Expand Up @@ -578,7 +578,7 @@ func (r *RewardsRepoTestSuite) Test_PaginateVehicleEarningsByID_FwdPagination_Em
r.NoError(err)

first := 2
after := "kwEAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
after := "kgEA"
paginatedEarnings, err := r.repo.PaginateVehicleEarningsByID(r.ctx, rwrd, &first, &after, nil, nil)
r.NoError(err)

Expand Down Expand Up @@ -758,7 +758,7 @@ func (r *RewardsRepoTestSuite) Test_PaginateVehicleEarningsByID_BackPagination_L
r.NoError(err)

last := 2
before := "kwEAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
before := "kgEA"
paginatedEarnings, err := r.repo.PaginateVehicleEarningsByID(r.ctx, rwrd, nil, nil, &last, &before)
r.NoError(err)

Expand Down Expand Up @@ -882,7 +882,7 @@ func (r *RewardsRepoTestSuite) Test_PaginateVehicleEarningsByID_BackPagination_E
r.NoError(err)

last := 2
before := "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
before := "kgMA"
paginatedEarnings, err := r.repo.PaginateVehicleEarningsByID(r.ctx, rwrd, nil, nil, &last, &before)
r.NoError(err)

Expand All @@ -902,7 +902,7 @@ func (r *RewardsRepoTestSuite) Test_PaginateVehicleEarningsByID_NoRows() {
r.NoError(err)

last := 2
before := "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
before := "kgMA"
paginatedEarnings, err := r.repo.PaginateVehicleEarningsByID(r.ctx, rwrd, nil, nil, &last, &before)
r.NoError(err)

Expand Down Expand Up @@ -1084,7 +1084,7 @@ func (r *RewardsRepoTestSuite) Test_GetEarningsByAfterMarketDevice_FwdPagination
}

first := 2
after := "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
after := "kgMA"
aftID := 111

rwrd, err := r.repo.GetEarningsByAfterMarketDeviceID(r.ctx, aftID)
Expand Down Expand Up @@ -1287,7 +1287,7 @@ func (r *RewardsRepoTestSuite) Test_GetEarningsByAfterMarketDevice_BackPaginatio
}

last := 2
before := "kwEAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA="
before := "kgEA"

rwrd, err := r.repo.GetEarningsByAfterMarketDeviceID(r.ctx, 111)
r.NoError(err)
Expand Down

0 comments on commit 2ca2a73

Please sign in to comment.