Skip to content

Commit 3850ee0

Browse files
authored
Fixed form tests, updated uikit commit hash, fixed tests depending on drush. (#1338)
1 parent 01aa745 commit 3850ee0

9 files changed

+92
-1091
lines changed

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/behat/bootstrap/FeatureContext.php

+33-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ class FeatureContext extends DrupalContext {
6363
use WysiwygTrait;
6464
use VisibilityTrait;
6565

66+
/**
67+
* Keep track of drush output.
68+
*
69+
* @var string|bool
70+
*/
71+
protected $drushOutput;
72+
6673
/**
6774
* Assert that content is present in an iframe.
6875
*
@@ -205,7 +212,7 @@ public function paragraphsAddToParentEntityWithFields(string $field_name, string
205212
'entity_type' => $parent_entity_type,
206213
]);
207214

208-
$referenceItem = $node->get($parent_entity_field)->get($delta);
215+
$referenceItem = $node?->get($parent_entity_field)->get($delta);
209216
if (!$referenceItem) {
210217
throw new \Exception(sprintf('Unable to find entity that matches delta: "%s"', print_r($delta, TRUE)));
211218
}
@@ -559,4 +566,29 @@ public function elementAssertAttributeContains(string $selector, string $attribu
559566
}
560567
}
561568

569+
/**
570+
* Step to run drush commands.
571+
*
572+
* @Given I run drush :command :arguments
573+
*/
574+
public function assertDrushCommandWithArgument(string $command, string $arguments): void {
575+
$this->drushOutput = $this->getDriver('drush')->$command($this->fixStepArgument($arguments));
576+
if (!empty($this->drushOutput)) {
577+
$this->drushOutput = TRUE;
578+
}
579+
}
580+
581+
/**
582+
* Returns fixed step argument (with \\" replaced back to ").
583+
*
584+
* @param string $argument
585+
* Argument to update.
586+
*
587+
* @return string
588+
* Modified step argument.
589+
*/
590+
protected function fixStepArgument($argument): string {
591+
return str_replace('\\"', '"', $argument);
592+
}
593+
562594
}

tests/behat/features/webform.enquiry.render.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Feature: Webform render
66
Given I am an anonymous user
77
When I visit "/enquiry"
88
Then I press the "Send" button
9-
And I should see "First name field is required."
9+
And I should see "Your first name is required."
1010
And I should see "Last name field is required."
1111
And I should see "Phone number field is required."
1212
And I should see "Email field is required."

tests/behat/features/webform.feedback.render.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Feature: Webform render
44
@api @javascript
55
Scenario: Form inputs are correctly validated
66
Given I am an anonymous user
7-
When I visit "/form/civictheme-feedback"
7+
When I visit "/feedback"
88
And I should see 3 ".progress-step" elements
99
And I should see the text "Personal information"
1010
And I should see the text "Additional information"

tests/behat/features/xmlsitemap.feature

+9-10
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,19 @@ Feature: XML Sitemap
55
Scenario: XML Sitemap is accessible
66

77
Given civictheme_page content:
8-
| title | status | path |
9-
| [TEST] Published page | 1 | /test-published-page |
10-
| [TEST] Draft page | 0 | /test-draft-page |
8+
| title | status | moderation_state | path |
9+
| [TEST] Published page | 1 | published | /test-published-page |
10+
| [TEST] Draft page | 0 | draft | /test-draft-page |
1111
And civictheme_event content:
12-
| title | status | path |
13-
| [TEST] Published event | 1 | /events/test-published-event |
14-
| [TEST] Draft event | 0 | /events/test-draft-event |
12+
| title | status | moderation_state | path |
13+
| [TEST] Published event | 1 | published | /events/test-published-event |
14+
| [TEST] Draft event | 0 | draft | /events/test-draft-event |
1515
And civictheme_alert content:
16-
| title | status | path |
17-
| [TEST] Published alert | 1 | /alerts/test-published-alert |
18-
| [TEST] Draft alert | 0 | /alerts/test-draft-alert |
16+
| title | status | moderation_state | path |
17+
| [TEST] Published alert | 1 | published | /alerts/test-published-alert |
18+
| [TEST] Draft alert | 0 | draft | /alerts/test-draft-alert |
1919

2020
Given I run drush "simple-sitemap:generate" "--uri=http://example.com"
21-
2221
When I go to "sitemap.xml"
2322
Then the response status code should be 200
2423

web/themes/contrib/civictheme/config/install/webform.webform.civictheme_enquiry.yml

+19-18
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
langcode: en
22
status: open
33
dependencies: { }
4+
weight: 0
45
open: null
56
close: null
6-
weight: 0
77
uid: 1
88
template: false
99
archive: false
@@ -19,6 +19,7 @@ elements: |-
1919
'#type': textfield
2020
'#title': 'First name'
2121
'#required': true
22+
'#required_error': 'Your first name is required.'
2223
last_name:
2324
'#type': textfield
2425
'#title': 'Last name'
@@ -77,9 +78,9 @@ settings:
7778
page_theme_name: ''
7879
form_title: both
7980
form_submit_once: false
80-
form_exception_message: ''
8181
form_open_message: ''
8282
form_close_message: ''
83+
form_exception_message: ''
8384
form_previous_submissions: true
8485
form_confidential: false
8586
form_confidential_message: ''
@@ -89,28 +90,36 @@ settings:
8990
form_prepopulate_source_entity: false
9091
form_prepopulate_source_entity_required: false
9192
form_prepopulate_source_entity_type: ''
92-
form_reset: false
93+
form_unsaved: false
94+
form_disable_back: false
95+
form_submit_back: false
9396
form_disable_autocomplete: false
9497
form_novalidate: true
9598
form_disable_inline_errors: false
9699
form_required: false
97-
form_unsaved: false
98-
form_disable_back: false
99-
form_submit_back: false
100100
form_autofocus: false
101101
form_details_toggle: false
102+
form_reset: false
102103
form_access_denied: default
103104
form_access_denied_title: ''
104105
form_access_denied_message: ''
105106
form_access_denied_attributes: { }
106107
form_file_limit: ''
108+
form_attributes: { }
109+
form_method: ''
110+
form_action: ''
107111
share: false
108112
share_node: false
109113
share_theme_name: ''
110114
share_title: true
111115
share_page_body_attributes: { }
112116
submission_label: ''
117+
submission_exception_message: ''
118+
submission_locked_message: ''
113119
submission_log: false
120+
submission_excluded_elements: { }
121+
submission_exclude_empty: false
122+
submission_exclude_empty_checkbox: false
114123
submission_views: { }
115124
submission_views_replace: { }
116125
submission_user_columns: { }
@@ -119,11 +128,6 @@ settings:
119128
submission_access_denied_title: ''
120129
submission_access_denied_message: ''
121130
submission_access_denied_attributes: { }
122-
submission_exception_message: ''
123-
submission_locked_message: ''
124-
submission_excluded_elements: { }
125-
submission_exclude_empty: false
126-
submission_exclude_empty_checkbox: false
127131
previous_submission_message: ''
128132
previous_submissions_message: ''
129133
autofill: false
@@ -134,13 +138,13 @@ settings:
134138
wizard_progress_percentage: false
135139
wizard_progress_link: false
136140
wizard_progress_states: false
137-
wizard_auto_forward: true
138-
wizard_auto_forward_hide_next_button: false
139-
wizard_keyboard: true
140141
wizard_start_label: ''
141142
wizard_preview_link: false
142143
wizard_confirmation: true
143144
wizard_confirmation_label: ''
145+
wizard_auto_forward: true
146+
wizard_auto_forward_hide_next_button: false
147+
wizard_keyboard: true
144148
wizard_track: ''
145149
wizard_prev_button_label: ''
146150
wizard_next_button_label: ''
@@ -163,9 +167,9 @@ settings:
163167
draft_pending_single_message: ''
164168
draft_pending_multiple_message: ''
165169
confirmation_type: page
170+
confirmation_url: ''
166171
confirmation_title: ''
167172
confirmation_message: ''
168-
confirmation_url: ''
169173
confirmation_attributes: { }
170174
confirmation_back: true
171175
confirmation_back_label: ''
@@ -194,9 +198,6 @@ settings:
194198
token_update: false
195199
token_delete: false
196200
serial_disabled: false
197-
form_method: ''
198-
form_action: ''
199-
form_attributes: { }
200201
access:
201202
create:
202203
roles:

web/themes/contrib/civictheme/config/install/webform.webform.civictheme_feedback.yml

+22-20
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
langcode: en
22
status: open
33
dependencies: { }
4+
weight: 0
45
open: null
56
close: null
6-
weight: 0
77
uid: 1
88
template: false
99
archive: false
1010
id: civictheme_feedback
1111
title: 'General form'
12-
description: 'A simple multi-step form.'
12+
description: '<p>A simple multi-step form.</p>'
1313
categories: { }
1414
elements: |-
1515
personal_information:
@@ -87,14 +87,14 @@ settings:
8787
ajax_effect: ''
8888
ajax_speed: null
8989
page: true
90-
page_submit_path: /enquiry
90+
page_submit_path: /feedback
9191
page_confirm_path: ''
9292
page_theme_name: ''
9393
form_title: both
9494
form_submit_once: false
95-
form_exception_message: ''
9695
form_open_message: ''
9796
form_close_message: ''
97+
form_exception_message: ''
9898
form_previous_submissions: true
9999
form_confidential: false
100100
form_confidential_message: ''
@@ -104,28 +104,36 @@ settings:
104104
form_prepopulate_source_entity: false
105105
form_prepopulate_source_entity_required: false
106106
form_prepopulate_source_entity_type: ''
107-
form_reset: false
107+
form_unsaved: false
108+
form_disable_back: false
109+
form_submit_back: false
108110
form_disable_autocomplete: false
109111
form_novalidate: true
110112
form_disable_inline_errors: false
111113
form_required: false
112-
form_unsaved: false
113-
form_disable_back: false
114-
form_submit_back: false
115114
form_autofocus: false
116115
form_details_toggle: false
116+
form_reset: false
117117
form_access_denied: default
118118
form_access_denied_title: ''
119119
form_access_denied_message: ''
120120
form_access_denied_attributes: { }
121121
form_file_limit: ''
122+
form_attributes: { }
123+
form_method: ''
124+
form_action: ''
122125
share: false
123126
share_node: false
124127
share_theme_name: ''
125128
share_title: true
126129
share_page_body_attributes: { }
127130
submission_label: ''
131+
submission_exception_message: ''
132+
submission_locked_message: ''
128133
submission_log: false
134+
submission_excluded_elements: { }
135+
submission_exclude_empty: false
136+
submission_exclude_empty_checkbox: false
129137
submission_views: { }
130138
submission_views_replace: { }
131139
submission_user_columns: { }
@@ -134,11 +142,6 @@ settings:
134142
submission_access_denied_title: ''
135143
submission_access_denied_message: ''
136144
submission_access_denied_attributes: { }
137-
submission_exception_message: ''
138-
submission_locked_message: ''
139-
submission_excluded_elements: { }
140-
submission_exclude_empty: false
141-
submission_exclude_empty_checkbox: false
142145
previous_submission_message: ''
143146
previous_submissions_message: ''
144147
autofill: false
@@ -149,19 +152,21 @@ settings:
149152
wizard_progress_percentage: false
150153
wizard_progress_link: false
151154
wizard_progress_states: false
152-
wizard_auto_forward: true
153-
wizard_auto_forward_hide_next_button: false
154-
wizard_keyboard: true
155155
wizard_start_label: ''
156156
wizard_preview_link: false
157157
wizard_confirmation: true
158158
wizard_confirmation_label: ''
159+
wizard_auto_forward: true
160+
wizard_auto_forward_hide_next_button: false
161+
wizard_keyboard: true
159162
wizard_track: ''
160163
wizard_prev_button_label: ''
161164
wizard_next_button_label: ''
162165
wizard_toggle: false
163166
wizard_toggle_show_label: ''
164167
wizard_toggle_hide_label: ''
168+
wizard_page_type: container
169+
wizard_page_title_tag: h2
165170
preview: 0
166171
preview_label: ''
167172
preview_title: ''
@@ -178,9 +183,9 @@ settings:
178183
draft_pending_single_message: ''
179184
draft_pending_multiple_message: ''
180185
confirmation_type: page
186+
confirmation_url: ''
181187
confirmation_title: ''
182188
confirmation_message: ''
183-
confirmation_url: ''
184189
confirmation_attributes: { }
185190
confirmation_back: true
186191
confirmation_back_label: ''
@@ -209,9 +214,6 @@ settings:
209214
token_update: false
210215
token_delete: false
211216
serial_disabled: false
212-
form_method: ''
213-
form_action: ''
214-
form_attributes: { }
215217
access: { }
216218
handlers: { }
217219
variants: { }

web/themes/contrib/civictheme/config/optional/search_api.index.civictheme_content.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@ langcode: en
22
status: true
33
dependencies:
44
config:
5-
- field.storage.node.field_c_n_summary
65
- field.storage.node.field_c_n_components
6+
- field.storage.node.field_c_n_summary
77
- field.storage.paragraph.field_c_p_content
8-
- field.storage.paragraph.field_c_p_summary
9-
- field.storage.paragraph.field_c_p_title
108
- field.storage.paragraph.field_c_p_list_items
119
- field.storage.paragraph.field_c_p_subtitle
10+
- field.storage.paragraph.field_c_p_summary
11+
- field.storage.paragraph.field_c_p_title
1212
- search_api.server.civictheme_database
1313
module:
14-
- paragraphs
1514
- node
16-
- search_api
15+
- paragraphs
1716
id: civictheme_content
1817
name: Content
1918
description: ''
@@ -184,4 +183,5 @@ options:
184183
cron_limit: 50
185184
index_directly: true
186185
track_changes_in_references: true
186+
delete_on_fail: true
187187
server: civictheme_database

0 commit comments

Comments
 (0)