From 2ca2a731241899458d8983cb7de2229ebfcb0d45 Mon Sep 17 00:00:00 2001 From: 0xdev22 Date: Thu, 16 Nov 2023 11:55:58 -0500 Subject: [PATCH] Fix failing tests --- graph/rewards_test.go | 56 +++++++++++++-------------- internal/repositories/rewards_test.go | 14 +++---- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/graph/rewards_test.go b/graph/rewards_test.go index 406262e7..21bb7f76 100644 --- a/graph/rewards_test.go +++ b/graph/rewards_test.go @@ -208,7 +208,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_FwdPaginate() { "totalCount": 1, "edges": [ { - "cursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=", + "cursor": "kgIA", "node": { "week": 2, "beneficiary": "%s", @@ -240,10 +240,10 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_FwdPaginate() { } ], "pageInfo": { - "endCursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=", + "endCursor": "kgIA", "hasNextPage": false, "hasPreviousPage": false, - "startCursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=" + "startCursor": "kgIA" } } } @@ -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 @@ -384,7 +384,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_FwdPaginate_Firs "totalCount": 3, "edges": [ { - "cursor": "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=", + "cursor": "kgMA", "node": { "week": 3, "beneficiary": "%s", @@ -408,7 +408,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_FwdPaginate_Firs } }, { - "cursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=", + "cursor": "kgIA", "node": { "week": 2, "beneficiary": "%s", @@ -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" } } } @@ -589,7 +589,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_BackPaginate_Las "totalCount": 3, "edges": [ { - "cursor": "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=", + "cursor": "kgMA", "node": { "week": 3, "beneficiary": "%s", @@ -613,7 +613,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_BackPaginate_Las } }, { - "cursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=", + "cursor": "kgIA", "node": { "week": 2, "beneficiary": "%s", @@ -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" } } } @@ -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 @@ -794,7 +794,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_BackPaginate_Las "totalCount": 3, "edges": [ { - "cursor": "kwQAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=", + "cursor": "kgQA", "node": { "week": 4, "beneficiary": "%s", @@ -818,7 +818,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetEarningsByVehicle_BackPaginate_Las } }, { - "cursor": "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=", + "cursor": "kgMA", "node": { "week": 3, "beneficiary": "%s", @@ -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" } } } @@ -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": [ { @@ -974,7 +974,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetAftermarketDeviceEarnings_FwdPagin "beneficiary": "%s", "connectionStreak": 20 }, - "cursor": "kwIAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=" + "cursor": "kgIA" } ] } @@ -1124,7 +1124,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetUserRewards_FwdPaginate() { "tokenId": 1 } }, - "cursor": "kwQAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=" + "cursor": "kgQA" }, { "node": { @@ -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 } @@ -1297,7 +1297,7 @@ func (r *RewardsQueryTestSuite) Test_Query_GetUserRewards_BackPaginate_LastBefor "tokenId": 1 } }, - "cursor": "kwMAxCoweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=" + "cursor": "kgMA" }, { "node": { @@ -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 } diff --git a/internal/repositories/rewards_test.go b/internal/repositories/rewards_test.go index e1878b0e..fda21aae 100644 --- a/internal/repositories/rewards_test.go +++ b/internal/repositories/rewards_test.go @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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)