Skip to content

Commit 6ddb9b7

Browse files
organizations pagination test case added, Secrets Scan workflow removed
1 parent b7fac60 commit 6ddb9b7

2 files changed

Lines changed: 36 additions & 12 deletions

File tree

.github/workflows/secrets-scan.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
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

test/unit/util/common-utils.test.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { fancy } from "fancy-test";
22
import { expect } from "@oclif/test";
33
import {
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) =>

0 commit comments

Comments
 (0)