Skip to content

Commit

Permalink
Fix CF7 tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kagg-design committed Nov 3, 2024
1 parent 8d9d0c3 commit b165a6c
Showing 1 changed file with 30 additions and 47 deletions.
77 changes: 30 additions & 47 deletions .tests/php/integration/CF7/AdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,55 +415,39 @@ public function test_tag_generator_hcaptcha(): void {
'title' => 'hCaptcha',
'content' => 'tag-generator-panel-cf7-hcaptcha',
];
$expected = ' <div class="control-box">
$expected = ' <header class="description-box">
<h3>hCaptcha field form-tag generator</h3>
<p>Generate a form-tag for a hCaptcha field.</p>
</header>
<div class="control-box">
<fieldset>
<legend>Generate a form-tag for a hCaptcha field.</legend>
<table class="form-table">
<tbody>
<tr>
<th scope="row">
<label for="tag-generator-panel-cf7-hcaptcha-id">
Id attribute </label>
</th>
<td>
<input
type="text" name="id" class="idvalue oneline option"
id="tag-generator-panel-cf7-hcaptcha-id"/>
</td>
</tr>
<tr>
<th scope="row">
<label for="tag-generator-panel-cf7-hcaptcha-class">
Class attribute </label>
</th>
<td>
<input
type="text" name="class" class="classvalue oneline option"
id="tag-generator-panel-cf7-hcaptcha-class"/>
</td>
</tr>
</tbody>
</table>
</fieldset>
<legend id="tag-generator-panel-cf7-hcaptcha-type-legend">Field type</legend>
<select data-tag-part="basetype" aria-labelledby="tag-generator-panel-cf7-hcaptcha-type-legend"><option value="cf7-hcaptcha">hCaptcha field</option></select>
<br />
<label>
<input type="checkbox" data-tag-part="type-suffix" value="*" />
This is a required field. </label>
</fieldset>
<fieldset>
<legend id="tag-generator-panel-cf7-hcaptcha-name-legend">Field name</legend>
<input type="text" data-tag-part="name" pattern="[A-Za-z][A-Za-z0-9_\-]*" aria-labelledby="tag-generator-panel-cf7-hcaptcha-name-legend" />
</fieldset>
<fieldset>
<legend id="tag-generator-panel-cf7-hcaptcha-class-legend">Class attribute</legend>
<input type="text" data-tag-part="option" data-tag-option="class:" pattern="[A-Za-z0-9_\-\s]*" aria-labelledby="tag-generator-panel-cf7-hcaptcha-class-legend" />
</fieldset>
</div>
<div class="insert-box">
<label>
<input
type="text" name="cf7-hcaptcha" class="tag code" readonly="readonly"
onfocus="this.select()"/>
</label>
<div class="submitbox">
<input
type="button" class="button button-primary insert-tag"
value="Insert Tag"/>
</div>
</div>
<footer class="insert-box">
<div class="flex-container">
<input type="text" class="code" readonly="readonly" onfocus="this.select();" data-tag-part="tag" aria-label="The form-tag to be inserted into the form template" /> <button type="button" class="button button-primary" data-taggen="insert-tag">Insert Tag</button>
</div>
<p class="mail-tag-tip">To use the user input in the email, insert the corresponding mail-tag <strong data-tag-part="mail-tag"></strong> into the email template.</p>
</footer>
';

$subject = new Admin();
Expand All @@ -477,7 +461,6 @@ public function test_tag_generator_hcaptcha(): void {
* Test enqueue_admin_scripts_before_cf7() and enqueue_admin_scripts_after_cf7().
*
* @noinspection PhpConditionAlreadyCheckedInspection
* @noinspection PhpUndefinedConstantInspection
*/
public function test_enqueue_admin_scripts(): void {
global $wp_scripts;
Expand Down

0 comments on commit b165a6c

Please sign in to comment.