Skip to content

Commit a297264

Browse files
committed
fix: add sanity-check mock content-type.js for unit tests
Unit tests (test/unit/mock/objects.js) import singlepageCT from ../../sanity-check/mock/content-type. Add content-type.js so test:unit:report:json runs and report.json is generated in CI.
1 parent cbd293b commit a297264

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* Content type mock for unit tests (singlepageCT).
3+
* Mirrors test/typescript/mock/contentType.ts for test/unit/mock/objects.js.
4+
*/
5+
export const singlepageCT = {
6+
content_type: {
7+
options: {
8+
is_page: true,
9+
singleton: true,
10+
title: 'title',
11+
sub_title: []
12+
},
13+
title: 'Single Page',
14+
uid: 'single_page',
15+
schema: [
16+
{
17+
display_name: 'Title',
18+
uid: 'title',
19+
data_type: 'text',
20+
mandatory: true,
21+
unique: true,
22+
field_metadata: { _default: true }
23+
},
24+
{
25+
display_name: 'URL',
26+
uid: 'url',
27+
data_type: 'text',
28+
mandatory: true,
29+
field_metadata: { _default: true, instruction: '' }
30+
}
31+
]
32+
},
33+
prevcreate: true
34+
}

0 commit comments

Comments
 (0)