diff --git a/specs/resource.spec.ts b/specs/resource.spec.ts index 9191dd4..6041543 100644 --- a/specs/resource.spec.ts +++ b/specs/resource.spec.ts @@ -8,6 +8,8 @@ let clp: CommerceLayerProvisioningClient let memberships: ListResponse let tempId: string +const organizationSlug = process.env.CL_SDK_ORGANIZATION + beforeAll(async () => { clp = await getClient({}) @@ -61,14 +63,16 @@ describe('SDK:resource suite', () => { it('resource.create', async () => { const user_email = 'spec@provisioning-sdk-test.org' - const org = (await clp.organizations.list()).first() + const params = organizationSlug ? { filters: { slug_eq: organizationSlug } } : undefined + const org = (await clp.organizations.list(params)).first() + console.log(org) const role = (await clp.roles.list()).first() if (!org || !role) throw new Error('Missing role or organization') const ms = await clp.memberships.create({ user_email, organization: clp.organizations.relationship(org), role: clp.roles.relationship(role) - }) + }).catch(err => { console.log(err); throw err }) expect(ms.id).not.toBeUndefined() expect(ms.user_email).toEqual(user_email) tempId = ms.id diff --git a/specs/sdk.spec.ts b/specs/sdk.spec.ts index 0cc667a..94a36e6 100644 --- a/specs/sdk.spec.ts +++ b/specs/sdk.spec.ts @@ -71,7 +71,6 @@ describe('SDK suite', () => { it('response.emptyBody', async () => { - jest.setTimeout(15_000) const cli = await getClient({}) diff --git a/test/common.ts b/test/common.ts index 48d7bdf..d1b2d28 100644 --- a/test/common.ts +++ b/test/common.ts @@ -156,7 +156,6 @@ const checkCommon = (request: RequestObj, path: string, id?: string, token?: str } const checkCommonData = (data: any, type: string, attributes: any, id?: string) => { - if (type === 'identity_providers') console.log(data) if (id) expect(data.data.id).toBe(id) expect(data.data.type).toBe(type) const relationships: { [k: string]: any } = {}