Skip to content

Commit 6a030c9

Browse files
WIP: Include all block types in feature tests for both form and non-form schema
- still to add lead to both feature tests - adding objects to both as is (which is broken) and forms
1 parent 2b7fb83 commit 6a030c9

4 files changed

Lines changed: 247 additions & 10 deletions

File tree

features/fixtures/test_configurable_document_type.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,33 @@
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+
}
2343
}
2444
}
2545
},
2646
"associations": [],
2747
"settings": {
2848
"edit_screens": {
29-
"document": ["body", "date_field"],
49+
"document": ["body", "date_field", "address"],
3050
"images": ["image"]
3151
},
3252
"base_path_prefix": "/government/test-type",
@@ -38,4 +58,4 @@
3858
"translations_enabled": true,
3959
"images_enabled": true
4060
}
41-
}
61+
}

features/fixtures/test_configurable_document_type_with_forms.json

Lines changed: 23 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
},
@@ -44,6 +61,12 @@
4461
},
4562
"date_field": {
4663
"type": "date"
64+
},
65+
"street": {
66+
"type": "string"
67+
},
68+
"city": {
69+
"type": "string"
4770
}
4871
}
4972
},

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)