-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01c6af7
commit d986c5e
Showing
3 changed files
with
121 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ import { | |
PostCredentialsOperationRequest, | ||
PostCredentialsRequest, | ||
ManagementClient, | ||
GetClientsRequest, | ||
} from '../../src/index.js'; | ||
|
||
import { RequiredError } from '../../src/lib/errors.js'; | ||
|
@@ -138,16 +139,25 @@ describe('ClientsManager', () => { | |
it('should pass the parameters in the query-string', (done) => { | ||
nock.cleanAll(); | ||
|
||
const queryParameters: GetClientsRequest | any = { | ||
fields: 'name,email', | ||
include_fields: true, | ||
page: 0, | ||
per_page: 50, | ||
include_totals: false, | ||
from: '12345', | ||
take: 50, | ||
is_global: true, | ||
is_first_party: false, | ||
app_type: 'web,mobile', | ||
client_ids: 'client1,client2,client3', | ||
q: 'name:John AND email:[email protected]', | ||
}; | ||
|
||
const data = [{ client_id: '1' }]; | ||
const request = nock(API_URL) | ||
.get('/clients') | ||
.query({ | ||
include_fields: true, | ||
fields: 'test', | ||
}) | ||
.reply(200, data); | ||
const request = nock(API_URL).get('/clients').query(queryParameters).reply(200, data); | ||
|
||
clients.getAll({ include_fields: true, fields: 'test' }).then(() => { | ||
clients.getAll({ ...queryParameters }).then(() => { | ||
expect(request.isDone()).toBe(true); | ||
done(); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters