Skip to content

Commit 508c45c

Browse files
committed
test: Add Integration test for Editor Interface
1 parent 150dc61 commit 508c45c

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

test/integration/content-type-integration.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export function contentTypeReadOnlyTests (t, space) {
2121
}
2222

2323
export function contentTypeWriteTests (t, space) {
24-
t.test('Create, update, publish, unpublish and delete content type', (t) => {
25-
t.plan(7)
24+
t.test('Create, update, publish, getEditorInterface, unpublish and delete content type', (t) => {
25+
t.plan(10)
2626
return space.createContentType({name: 'testentity'})
2727
.then((contentType) => {
2828
t.ok(contentType.isDraft(), 'contentType is in draft')
@@ -38,10 +38,16 @@ export function contentTypeWriteTests (t, space) {
3838
.then((updatedContentType) => {
3939
t.ok(updatedContentType.isUpdated(), 'contentType is updated')
4040
t.equals(updatedContentType.fields[0].id, 'field', 'field id')
41-
return updatedContentType.unpublish()
42-
.then((unpublishedContentType) => {
43-
t.ok(unpublishedContentType.isDraft(), 'contentType is back in draft')
44-
return unpublishedContentType.delete()
41+
t.ok(updatedContentType.getEditorInterface, 'updatedContentType.getEditorInterface')
42+
return updatedContentType.getEditorInterface()
43+
.then((response) => {
44+
t.ok(response.controls, 'editor interface controls')
45+
t.ok(response.sys, 'editor interface sys')
46+
return updatedContentType.unpublish()
47+
.then((unpublishedContentType) => {
48+
t.ok(unpublishedContentType.isDraft(), 'contentType is back in draft')
49+
return unpublishedContentType.delete()
50+
})
4551
})
4652
})
4753
})

test/integration/integration-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ test('Create space for tests which create, change and delete data', (t) => {
8585
// Also comment the test.onFinish line below to avoid removing the space.
8686
// The below line also uses double quotes on purpose so it breaks the linter
8787
// in case someone forgets to comment this line again.
88-
// client.getSpace("")
88+
// client.getSpace('a3f19zbn5ldg')
8989
.then((space) => {
9090
return space.createLocale({
9191
name: 'German (Germany)',

0 commit comments

Comments
 (0)