@@ -56,7 +56,17 @@ describe('Campaigns with callback', () => {
5656 it ( 'should list all subscribers to a campaign and call request with get' , ( done ) => {
5757 expect ( typeof client . listAllSubscribesToCampaign ) . toEqual ( 'function' ) ;
5858
59- client . listAllSubscribesToCampaign ( campaignId , ( error , response ) => {
59+ client . listAllSubscribesToCampaign ( campaignId , { } , ( error , response ) => {
60+ expect ( response . statusCode ) . toBe ( 200 ) ;
61+ expect ( client . request . callCount ) . toBe ( 1 ) ;
62+ } ) ;
63+ done ( ) ;
64+ } ) ;
65+
66+ it ( 'should list all active subscribers to a campaign and call request with get' , ( done ) => {
67+ expect ( typeof client . listAllSubscribesToCampaign ) . toEqual ( 'function' ) ;
68+
69+ client . listAllSubscribesToCampaign ( campaignId , { status : 'active' } , ( error , response ) => {
6070 expect ( response . statusCode ) . toBe ( 200 ) ;
6171 expect ( client . request . callCount ) . toBe ( 1 ) ;
6272 } ) ;
@@ -155,15 +165,29 @@ describe('Campaigns with Promise', () => {
155165 it ( 'should list all subscribers to a campaign' , ( done ) => {
156166 expect ( typeof client . listAllSubscribesToCampaign ) . toEqual ( 'function' ) ;
157167
158- client . listAllSubscribesToCampaign ( campaignId )
168+ client . listAllSubscribesToCampaign ( campaignId , { } )
169+ . then ( ( response ) => {
170+ expect ( response . statusCode ) . toBe ( 200 ) ;
171+ expect ( client . request . callCount ) . toBe ( 1 ) ;
172+ } )
173+ . catch ( failTest ) ;
174+ done ( ) ;
175+
176+ expect ( client . get ) . toHaveBeenCalledWith ( 'v2/9999999/campaigns/4444444/subscribers' , { qs : { } } , undefined ) ;
177+ } ) ;
178+
179+ it ( 'should list all active subscribers to a campaign' , ( done ) => {
180+ expect ( typeof client . listAllSubscribesToCampaign ) . toEqual ( 'function' ) ;
181+
182+ client . listAllSubscribesToCampaign ( campaignId , { status : 'active' } )
159183 . then ( ( response ) => {
160184 expect ( response . statusCode ) . toBe ( 200 ) ;
161185 expect ( client . request . callCount ) . toBe ( 1 ) ;
162186 } )
163187 . catch ( failTest ) ;
164188 done ( ) ;
165189
166- expect ( client . get ) . toHaveBeenCalledWith ( 'v2/9999999/campaigns/4444444/subscribers' , { } , undefined ) ;
190+ expect ( client . get ) . toHaveBeenCalledWith ( 'v2/9999999/campaigns/4444444/subscribers' , { qs : { status : 'active' } } , undefined ) ;
167191 } ) ;
168192
169193 it ( 'should list all subscribers to a campaign' , ( done ) => {
0 commit comments