Skip to content

Commit

Permalink
add test for equal results (amend PR facundoolano#677)
Browse files Browse the repository at this point in the history
For detection of facundoolano#676 (less than actual number of requests returned, different response count on each request).

Using app with large number of reviews sorted by helpfulness (assuming this set does not change as frequently as just reviews), num: 1500 is reasonably fast and we get 2 x 10 paged requests (of 150 results) that ought to prove paging works.
  • Loading branch information
Peeter Marvet committed Apr 8, 2024
1 parent 4e110ef commit 4461113
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/lib.reviews.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,25 @@ describe('Reviews method', () => {
assert.isNotNull(secondPaginationToken);
assert.notDeepEqual(data, dataSecondPage);
});

it('should get same set of reviews on each run', async () => {
const firstPageReviews = await gplay.reviews({
appId: 'com.facebook.katana',
num: 1500,
sort: constants.sort.HELPFULNESS
});
const { data } = firstPageReviews;

assert.equal(data.length, 1500);

const secondPageReviews = await gplay.reviews({
appId: 'com.facebook.katana',
num: 1500,
sort: constants.sort.HELPFULNESS
});
const { data: dataSecondPage } = secondPageReviews;

assert.equal(dataSecondPage.length, 1500);
assert.deepEqual(data, dataSecondPage);
});
});

0 comments on commit 4461113

Please sign in to comment.