@@ -7,6 +7,7 @@ const redisKey = require('../../src/utils/key.js');
77describe ( '#list' , function listSuite ( ) {
88 this . timeout ( 50000 ) ;
99
10+ const totalUsers = 105 ;
1011 const faker = require ( 'faker' ) ;
1112
1213 beforeEach ( 'start service' , global . startService ) ;
@@ -17,7 +18,7 @@ describe('#list', function listSuite() {
1718 const promises = [ ] ;
1819 const { USERS_INDEX , USERS_METADATA } = require ( '../../src/constants' ) ;
1920
20- ld . times ( 105 , ( ) => {
21+ ld . times ( totalUsers , ( ) => {
2122 const user = {
2223 id : this . users . flake . next ( ) ,
2324 metadata : {
@@ -59,6 +60,7 @@ describe('#list', function listSuite() {
5960 expect ( result . page ) . to . be . eq ( 6 ) ;
6061 expect ( result . pages ) . to . be . eq ( 11 ) ;
6162 expect ( result . cursor ) . to . be . eq ( 61 ) ;
63+ expect ( result . total ) . to . be . eq ( totalUsers ) ;
6264 expect ( result . users ) . to . have . lengthOf ( 10 ) ;
6365
6466 result . users . forEach ( ( user ) => {
@@ -312,6 +314,7 @@ describe('#list', function listSuite() {
312314 expect ( result . page ) . to . be . eq ( 1 ) ;
313315 expect ( result . pages ) . to . be . eq ( 11 ) ;
314316 expect ( result . cursor ) . to . be . eq ( 10 ) ;
317+ expect ( result . total ) . to . be . eq ( totalUsers ) ;
315318
316319 expect ( result . users ) . to . have . lengthOf ( 10 ) ;
317320 expect ( Array . isArray ( result . users ) ) . to . be . eq ( true ) ;
0 commit comments