Skip to content

Commit 19e73e8

Browse files
Fixed unit testcases
1 parent 5b39a0c commit 19e73e8

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/entity.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ export const create = ({ http, params }) => {
8989
return async function (data, param) {
9090
this.stackHeaders = {
9191
...this.stackHeaders,
92-
...(http.httpClientParams.headers?.api_version && { api_version: http.httpClientParams.headers.api_version })
9392
}
9493
const headers = {
9594
headers: {

test/unit/globalField-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ describe('Contentstack GlobalField test (API Version 3.2)', () => {
221221
stackHeaders: stackHeadersMock,
222222
api_version: '3.2' })
223223
expect(globalField.urlPath).to.be.equal('/global_fields')
224-
expect(globalField.apiVersion).to.be.equal('3.2')
225-
expect(globalField.stackHeaders).to.deep.equal({ api_key: 'api_key' })
224+
expect(globalField.stackHeaders.api_version).to.be.equal('3.2')
225+
expect(globalField.stackHeaders).to.deep.equal({ api_key: 'api_key', api_version: '3.2' })
226226
done()
227227
})
228228

@@ -237,7 +237,7 @@ describe('Contentstack GlobalField test (API Version 3.2)', () => {
237237
expect(globalField.urlPath).to.be.equal(
238238
`/global_fields/${systemUidMock.uid}`
239239
)
240-
expect(globalField.apiVersion).to.be.equal('3.2')
240+
expect(globalField.stackHeaders.api_version).to.be.equal('3.2')
241241
expect(globalField.update).to.not.equal(undefined)
242242
expect(globalField.delete).to.not.equal(undefined)
243243
expect(globalField.fetch).to.not.equal(undefined)
@@ -257,7 +257,7 @@ describe('Contentstack GlobalField test (API Version 3.2)', () => {
257257
expect(globalField.urlPath).to.be.equal(
258258
`/global_fields/${systemUidMock.uid}`
259259
)
260-
expect(globalField.apiVersion).to.be.equal('3.2')
260+
expect(globalField.stackHeaders.api_version).to.be.equal('3.2')
261261
expect(globalField.stackHeaders).to.not.equal(undefined)
262262
expect(globalField.stackHeaders.api_key).to.be.equal(
263263
stackHeadersMock.api_key

0 commit comments

Comments
 (0)