Skip to content

Commit e8a3c62

Browse files
refactor: Update mock paths to use 'sanity-check' directory instead of 'api'
1 parent 66b9b6d commit e8a3c62

14 files changed

+28
-28
lines changed

test/typescript/asset.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function createAsset(stack: Stack) {
99
describe('Asset create', () => {
1010
test('Asset Upload', done => {
1111
const asset = {
12-
upload: path.join(__dirname, '../api/mock/customUpload.html'),
12+
upload: path.join(__dirname, '../sanity-check/mock/customUpload.html'),
1313
title: 'customasset',
1414
description: 'Custom Asset Desc',
1515
tags: ['custom']
@@ -45,7 +45,7 @@ export function createAsset(stack: Stack) {
4545

4646
test('Upload asset in folder', done => {
4747
const asset = {
48-
upload: path.join(__dirname, '../api/mock/customUpload.html'),
48+
upload: path.join(__dirname, '../sanity-check/mock/customUpload.html'),
4949
title: 'customasset in Folder',
5050
description: 'Custom Asset Desc in Folder',
5151
parent_uid: folderUID,
@@ -93,7 +93,7 @@ export function replaceAsset(stack: Stack) {
9393
describe('Asset replace', () => {
9494
test('Replace Asset', done => {
9595
const asset = {
96-
upload: path.join(__dirname, '../api/mock/upload.html')
96+
upload: path.join(__dirname, '../sanity-check/mock/upload.html')
9797
}
9898

9999
stack.asset(assetUID)

test/typescript/contentType.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function createContentType(contentType: ContentTypes) {
2929

3030
test('Import Content type', done => {
3131
contentType.import({
32-
content_type: path.join(__dirname, '../api/mock/contentType.json')
32+
content_type: path.join(__dirname, '../sanity-check/mock/contentType.json')
3333
})
3434
.then((response) => {
3535
expect(response.uid).to.be.not.equal(null)

test/typescript/entry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export function importEntry(stack: Stack){
197197
describe('Import Entry', () => {
198198
test('Entry import from path', done => {
199199
stack.contentType(multiPageCT.content_type.uid).entry()
200-
.import({ entry: path.join(__dirname, '../api/mock/entry.json')})
200+
.import({ entry: path.join(__dirname, '../sanity-check/mock/entry.json')})
201201
.then((response) => {
202202
expect(response.uid).to.be.not.equal(null)
203203
done()

test/typescript/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from "chai"
22
import { Extensions } from "../../types/stack/extension";
3-
import { customFieldURL, customFieldSRC, customWidgetURL, customWidgetSRC, customDashboardURL, customDashboardSRC } from "../api/mock/extension";
3+
import { customFieldURL, customFieldSRC, customWidgetURL, customWidgetSRC, customDashboardURL, customDashboardSRC } from "../sanity-check/mock/extension";
44

55
var customFieldUID = ''
66
var customWidgetUID = ''

test/typescript/globalField.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function createGlobalField(globalField: GlobalFields) {
2323

2424
test('Import global field', done => {
2525
globalField.import({
26-
global_field: path.join(__dirname, '../api/mock/globalfield.json')
26+
global_field: path.join(__dirname, '../sanity-check/mock/globalfield.json')
2727
})
2828
.then((response) => {
2929
expect(response.uid).to.be.not.equal(null)

test/unit/asset-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ describe('Contentstack Asset test', () => {
113113
}
114114
})
115115
makeAsset()
116-
.create({ upload: path.join(__dirname, '../api/mock/customUpload.html') })
116+
.create({ upload: path.join(__dirname, '../sanity-check/mock/customUpload.html') })
117117
.then((asset) => {
118118
checkAsset(asset)
119119
done()
@@ -128,7 +128,7 @@ describe('Contentstack Asset test', () => {
128128
...assetMock
129129
}
130130
})
131-
const assetUpload = { upload: path.join(__dirname, '../api/mock/customUpload.html'), tags: 'tags' }
131+
const assetUpload = { upload: path.join(__dirname, '../sanity-check/mock/customUpload.html'), tags: 'tags' }
132132
const form = createFormData(assetUpload)()
133133
var boundary = form.getBoundary()
134134

@@ -151,7 +151,7 @@ describe('Contentstack Asset test', () => {
151151
}
152152
})
153153
const assetUpload = {
154-
upload: path.join(__dirname, '../api/mock/customUpload.html'),
154+
upload: path.join(__dirname, '../sanity-check/mock/customUpload.html'),
155155
title: 'customasset',
156156
description: 'Custom Asset Desc',
157157
tags: ['Custom'],
@@ -186,7 +186,7 @@ describe('Contentstack Asset test', () => {
186186
parent_uid: 'UID'
187187
}
188188
})
189-
const filePath = path.join(__dirname, '../api/mock/customUpload.html')
189+
const filePath = path.join(__dirname, '../sanity-check/mock/customUpload.html')
190190
const fileBuffer = fs.readFileSync(filePath)
191191
const assetUpload = {
192192
upload: fileBuffer, // Buffer upload
@@ -223,7 +223,7 @@ describe('Contentstack Asset test', () => {
223223
}
224224
})
225225
const assetUpload = {
226-
upload: path.join(__dirname, '../api/mock/customUpload.html'),
226+
upload: path.join(__dirname, '../sanity-check/mock/customUpload.html'),
227227
title: 'customasset',
228228
description: 'Custom Asset Desc',
229229
tags: ['Custom'],

test/unit/concurrency-Queue-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ describe('Concurrency queue test', () => {
377377
const fuc = (pathcontent) => {
378378
return () => {
379379
const formData = new FormData()
380-
const uploadStream = createReadStream(path.join(__dirname, '../api/mock/upload.html'))
380+
const uploadStream = createReadStream(path.join(__dirname, '../sanity-check/mock/upload.html'))
381381
formData.append('asset[upload]', uploadStream)
382382
return formData
383383
}

test/unit/contentType-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ describe('Contentstack ContentType test', () => {
241241
...contentTypeMock
242242
}
243243
})
244-
const contentTypeUpload = { content_type: path.join(__dirname, '../api/mock/contentType.json') }
244+
const contentTypeUpload = { content_type: path.join(__dirname, '../sanity-check/mock/contentType.json') }
245245
const form = createFormData(contentTypeUpload)()
246246
var boundary = form.getBoundary()
247247

@@ -263,7 +263,7 @@ describe('Contentstack ContentType test', () => {
263263
...contentTypeMock
264264
}
265265
})
266-
const contentTypeUpload = { content_type: path.join(__dirname, '../api/mock/contentType.json') }
266+
const contentTypeUpload = { content_type: path.join(__dirname, '../sanity-check/mock/contentType.json') }
267267
const form = createFormData(contentTypeUpload)()
268268
var boundary = form.getBoundary()
269269

test/unit/entry-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ describe('Contentstack Entry test', () => {
222222
...entryMock
223223
}
224224
})
225-
const entryUpload = { entry: path.join(__dirname, '../api/mock/entry.json') }
225+
const entryUpload = { entry: path.join(__dirname, '../sanity-check/mock/entry.json') }
226226
const form = createFormData(entryUpload.entry)()
227227
var boundary = form.getBoundary()
228228

@@ -245,7 +245,7 @@ describe('Contentstack Entry test', () => {
245245
}
246246
})
247247
makeEntry()
248-
.import({ entry: path.join(__dirname, '../api/mock/entry.json'), overwrite: true })
248+
.import({ entry: path.join(__dirname, '../sanity-check/mock/entry.json'), overwrite: true })
249249
.then((entry) => {
250250
checkEntry(entry)
251251
done()
@@ -261,7 +261,7 @@ describe('Contentstack Entry test', () => {
261261
}
262262
})
263263
makeEntry()
264-
.import({ entry: path.join(__dirname, '../api/mock/entry.json'), locale: 'en-us' })
264+
.import({ entry: path.join(__dirname, '../sanity-check/mock/entry.json'), locale: 'en-us' })
265265
.then((entry) => {
266266
checkEntry(entry)
267267
done()

test/unit/extension-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ describe('Contentstack Extension test', () => {
170170
}
171171
})
172172

173-
const extensionUpload = { upload: path.join(__dirname, '../api/mock/customUpload.html') }
173+
const extensionUpload = { upload: path.join(__dirname, '../sanity-check/mock/customUpload.html') }
174174
const form = createExtensionFormData(extensionUpload)()
175175
var boundary = form.getBoundary()
176176

@@ -195,7 +195,7 @@ describe('Contentstack Extension test', () => {
195195
}
196196
})
197197

198-
const extensionUpload = { upload: path.join(__dirname, '../api/mock/customUpload.html'), tags: 'tag1, tag2' }
198+
const extensionUpload = { upload: path.join(__dirname, '../sanity-check/mock/customUpload.html'), tags: 'tag1, tag2' }
199199
const form = createExtensionFormData(extensionUpload)()
200200
var boundary = form.getBoundary()
201201

@@ -225,7 +225,7 @@ describe('Contentstack Extension test', () => {
225225
tags: extensionMock.tags,
226226
enable: true,
227227
default_width: extensionMock.default_width,
228-
upload: path.join(__dirname, '../api/mock/customUpload.html'),
228+
upload: path.join(__dirname, '../sanity-check/mock/customUpload.html'),
229229
scope: {},
230230
multiple: true
231231
}

test/unit/globalField-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ describe('Contentstack GlobalField test', () => {
174174
}
175175
})
176176
const gfUpload = {
177-
global_field: path.join(__dirname, '../api/mock/globalfield.json')
177+
global_field: path.join(__dirname, '../sanity-check/mock/globalfield.json')
178178
}
179179
const form = createFormData(gfUpload)()
180180
var boundary = form.getBoundary()
@@ -198,7 +198,7 @@ describe('Contentstack GlobalField test', () => {
198198
}
199199
})
200200
const gfUpload = {
201-
global_field: path.join(__dirname, '../api/mock/globalfield.json')
201+
global_field: path.join(__dirname, '../sanity-check/mock/globalfield.json')
202202
}
203203
const form = createFormData(gfUpload)()
204204
var boundary = form.getBoundary()
@@ -395,7 +395,7 @@ describe('Contentstack GlobalField test (API Version 3.2)', () => {
395395
}
396396
})
397397
const gfUpload = {
398-
global_field: path.join(__dirname, '../api/mock/globalfield.json')
398+
global_field: path.join(__dirname, '../sanity-check/mock/globalfield.json')
399399
}
400400
const form = createFormData(gfUpload)()
401401
var boundary = form.getBoundary()
@@ -421,7 +421,7 @@ describe('Contentstack GlobalField test (API Version 3.2)', () => {
421421
}
422422
})
423423
const gfUpload = {
424-
global_field: path.join(__dirname, '../api/mock/globalfield.json')
424+
global_field: path.join(__dirname, '../sanity-check/mock/globalfield.json')
425425
}
426426
const form = createFormData(gfUpload)()
427427
var boundary = form.getBoundary()

test/unit/mock/objects.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import cloneDeep from 'lodash/cloneDeep'
2-
import { singlepageCT } from '../../api/mock/content-type'
2+
import { singlepageCT } from '../../sanity-check/mock/content-type'
33
import { expect } from 'chai'
44

55
const errorMock = {

test/unit/taxonomy-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ describe('Contentstack Taxonomy test', () => {
152152
...taxonomyMock
153153
}
154154
})
155-
const taxonomyUpload = { taxonomy: path.join(__dirname, '../api/mock/taxonomy.json') }
155+
const taxonomyUpload = { taxonomy: path.join(__dirname, '../sanity-check/mock/taxonomy.json') }
156156
const form = createFormData(taxonomyUpload)()
157157
var boundary = form.getBoundary()
158158

test/unit/webhook-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ describe('Contentstack Webhook test', () => {
303303
...webhookMock
304304
}
305305
})
306-
const webhookUpload = { webhook: path.join(__dirname, '../api/mock/customUpload.html') }
306+
const webhookUpload = { webhook: path.join(__dirname, '../sanity-check/mock/customUpload.html') }
307307
const form = createFormData(webhookUpload)()
308308
var boundary = form.getBoundary()
309309

0 commit comments

Comments
 (0)