Skip to content

Commit 94e1776

Browse files
authored
feat: add releaseSchema defaults to plain client creation [DX-184] (#2664)
* feat: add releaseSchema defaults to plain client creation * fix: rename releaseSchema to releaseSchemaVersion * fix: forgot to fix test
1 parent 3de1bf0 commit 94e1776

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/plain/wrappers/wrap.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export type DefaultParams = {
44
spaceId?: string
55
environmentId?: string
66
organizationId?: string
7+
releaseSchemaVersion?: 'Release.v1' | 'Release.v2'
78
}
89
/**
910
* @private

test/unit/contentful-management.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ describe('Contentful Management', () => {
4242
expect(createContentfulApiMock).not.toHaveBeenCalled()
4343
})
4444

45+
it('creates a plain client with releaseSchema defaults', () => {
46+
createClient(
47+
{ accessToken: 'token' },
48+
{ type: 'plain', defaults: { releaseSchemaVersion: 'Release.v2' } }
49+
)
50+
51+
expect(createPlainClientMock).toHaveBeenCalledWith(expect.any(Function), {
52+
releaseSchemaVersion: 'Release.v2',
53+
})
54+
expect(createContentfulApiMock).not.toHaveBeenCalled()
55+
})
56+
4557
it('generates the correct default user agent', () => {
4658
createClient({ accessToken: 'token' })
4759

0 commit comments

Comments
 (0)