File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Secrets Scan
2- on :
3- pull_request :
4- types : [opened, synchronize, reopened]
5- jobs :
6- security :
7- runs-on : ubuntu-latest
8- steps :
9- - uses : actions/checkout@v2
10- - name : Gittyleaks
11- uses : gupy-io/gittyleaks-action@v0.1
1+ # name: Secrets Scan
2+ # on:
3+ # pull_request:
4+ # types: [opened, synchronize, reopened]
5+ # jobs:
6+ # security:
7+ # runs-on: ubuntu-latest
8+ # steps:
9+ # - uses: actions/checkout@v2
10+ # - name: Gittyleaks
11+ # uses: gupy-io/gittyleaks-action@v0.1
Original file line number Diff line number Diff line change 11import { fancy } from "fancy-test" ;
22import { expect } from "@oclif/test" ;
33import {
4- ContentstackClient ,
54 configHandler ,
5+ ContentstackClient ,
66 managementSDKClient ,
77} from "@contentstack/cli-utilities" ;
88
@@ -40,6 +40,30 @@ describe("common utils", () => {
4040 } ) ;
4141 } ) ;
4242
43+ describe ( "Get list of organizations using pagination" , ( ) => {
44+ fancy
45+ . nock ( region . cma , ( api ) =>
46+ api
47+ . get (
48+ "/v3/organizations?limit=100&asc=name&include_count=true&skip=0"
49+ )
50+ . reply ( 200 , { organizations : mock . organizations , count : 110 } )
51+ )
52+ . nock ( region . cma , ( api ) =>
53+ api
54+ . get (
55+ "/v3/organizations?limit=100&asc=name&include_count=true&skip=100"
56+ )
57+ . reply ( 200 , { organizations : mock . organizations , count : 0 } )
58+ )
59+ . it ( "returns list of organizations" , async ( ) => {
60+ const organizations = await getOrganizations ( { log, managementSdk } ) ;
61+ const [ org1 , org2 ] = organizations ;
62+ expect ( org1 . uid ) . to . equal ( mock . organizations [ 0 ] . uid ) ;
63+ expect ( org2 . uid ) . to . equal ( mock . organizations [ 1 ] . uid ) ;
64+ } ) ;
65+ } ) ;
66+
4367 describe ( "Get list of organizations failure case" , async ( ) => {
4468 fancy
4569 . nock ( region . cma , ( api ) =>
You can’t perform that action at this time.
0 commit comments