Skip to content

Commit 2e4786a

Browse files
Include all block types in feature tests for both form and non-form schema
- included lead image block in both feature tests - included a nested/object block in both feature tests -> as-is is broken for a few scenarios TODO: remove TODOs
1 parent 8874fc6 commit 2e4786a

4 files changed

Lines changed: 276 additions & 14 deletions

File tree

features/fixtures/test_configurable_document_type.json

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,40 @@
2020
"title": "Date Field",
2121
"description": "A date field for the page",
2222
"type": "date"
23+
},
24+
"address": {
25+
"title": "Address",
26+
"description": "A nested object field",
27+
"type": "object",
28+
"format": "default",
29+
"properties": {
30+
"street": {
31+
"title": "Street",
32+
"description": "A default string inside the nested object",
33+
"type": "string",
34+
"format": "default"
35+
},
36+
"city": {
37+
"title": "City",
38+
"description": "Another default string inside the nested object",
39+
"type": "string",
40+
"format": "default"
41+
}
42+
}
43+
},
44+
"lead_image": {
45+
"title": "Lead Image",
46+
"description": "The lead image for the page",
47+
"format": "lead_image_select",
48+
"type": "integer"
2349
}
2450
}
2551
},
2652
"associations": [],
2753
"settings": {
2854
"edit_screens": {
29-
"document": ["body", "date_field"],
30-
"images": ["image"]
55+
"document": ["body", "date_field", "address"],
56+
"images": ["image", "lead_image"]
3157
},
3258
"base_path_prefix": "/government/test-type",
3359
"publishing_api_schema_name": "test_type",
@@ -38,4 +64,4 @@
3864
"translations_enabled": true,
3965
"images_enabled": true
4066
}
41-
}
67+
}

features/fixtures/test_configurable_document_type_with_forms.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@
1414
"title": "Date Field",
1515
"description": "A date field for the page",
1616
"block": "default_date"
17+
},
18+
"address": {
19+
"title": "Address",
20+
"description": "A nested object field",
21+
"block": "default_object",
22+
"fields": {
23+
"street": {
24+
"title": "Street",
25+
"description": "A default string inside the nested object",
26+
"block": "default_string"
27+
},
28+
"city": {
29+
"title": "City",
30+
"description": "Another default string inside the nested object",
31+
"block": "default_string"
32+
}
33+
}
1734
}
1835
}
1936
},
@@ -23,6 +40,11 @@
2340
"title": "Image",
2441
"description": "The image for the page",
2542
"block": "image_select"
43+
},
44+
"lead_image": {
45+
"title": "Lead Image",
46+
"description": "The lead image for the page",
47+
"block": "lead_image_select"
2648
}
2749
}
2850
}
@@ -44,6 +66,15 @@
4466
},
4567
"date_field": {
4668
"type": "date"
69+
},
70+
"street": {
71+
"type": "string"
72+
},
73+
"city": {
74+
"type": "string"
75+
},
76+
"lead_image": {
77+
"type": "integer"
4778
}
4879
}
4980
},

features/standard-edition-with-forms.feature

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@ Feature: Standard Editions
44
Given I am a writer
55
And the configurable document types feature flag is enabled
66
And the test configurable document type with forms is defined
7-
When I draft a new "Test configurable document type" configurable document titled "The history of GOV.UK"
7+
When I draft a new "Test configurable document type" configurable document with forms titled "The history of GOV.UK"
88
Then I am on the summary page of the draft titled "The history of GOV.UK"
99
And when I switch to the Images tab to fill in the other configurable fields
1010
Then the configurable fields on the Images tab are persisted
11-
And the configurable fields on the Document tab are not overwritten
11+
And the configurable fields - with forms - on the Document tab are not overwritten
1212

1313
Scenario: Force publishing an existing draft configurable document
1414
Given I am an editor
1515
And the configurable document types feature flag is enabled
1616
And the test configurable document type with forms is defined
17-
When I publish a submitted draft of a test configurable document titled "The history of GOV.UK"
17+
When I publish a submitted draft of a test configurable document with forms titled "The history of GOV.UK"
1818
Then I can see that the draft edition of "The history of GOV.UK" was published successfully
19-
And a new draft of "The history of GOV.UK" is created with the correct field values
19+
And a new draft of "The history of GOV.UK" is created with the correct field values - with forms
2020

2121
Scenario: Adding translations with all content block types
2222
Given I am a writer
2323
And the configurable document types feature flag is enabled
2424
And the test configurable document type with forms is defined with translations enabled
25-
And I have drafted an English configurable document titled "Digital transformation report"
25+
And I have drafted an English configurable document with forms titled "Digital transformation report"
2626
When I go to add a Welsh translation
2727
Then configured content blocks should appear on the translation page
28-
And the Welsh translation fields should be pre-populated with primary locale content
28+
And the Welsh translation fields should be pre-populated with primary locale content - with forms
2929
And the image selections should be preserved from the primary locale
3030
And I should see the original English content in "original text" sections
31-
And when I set the Welsh translations
31+
And when I set the Welsh translations - with forms
3232
Then the Welsh translations should have persisted
3333

3434
Scenario: Editing translations on a persisted edition

0 commit comments

Comments
 (0)