Skip to content

Commit

Permalink
Add question mark to checkbox options
Browse files Browse the repository at this point in the history
Update load.php
  • Loading branch information
aristath authored Jan 20, 2022
2 parents ea05aec + 7abd288 commit 50d740d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions admin/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ function perflab_render_modules_page_field( $module_slug, $module_data, $module_
if ( $module_data['experimental'] ) {
printf(
/* translators: %s: module name */
__( 'Enable %s <strong>(experimental)</strong>?', 'performance-lab' ),
__( 'Enable %s <strong>(experimental)</strong>', 'performance-lab' ),
esc_html( $module_data['name'] )
);
} else {
printf(
/* translators: %s: module name */
__( 'Enable %s?', 'performance-lab' ),
__( 'Enable %s', 'performance-lab' ),
esc_html( $module_data['name'] )
);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/admin/load-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function test_perflab_render_modules_page_field() {
$output = ob_get_clean();
$this->assertContains( ' id="module_' . $module_slug . '_enabled"', $output );
$this->assertContains( ' name="' . PERFLAB_MODULES_SETTING . '[' . $module_slug . '][enabled]"', $output );
$this->assertContains( 'Enable ' . $module_data['name'] . '?', $output );
$this->assertContains( 'Enable ' . $module_data['name'], $output );
$this->assertNotContains( ' checked', $output );

// Assert correct 'id' and 'name' attributes, experimental label, and checked checkbox.
Expand All @@ -171,7 +171,7 @@ public function test_perflab_render_modules_page_field() {
$output = ob_get_clean();
$this->assertContains( ' id="module_' . $module_slug . '_enabled"', $output );
$this->assertContains( ' name="' . PERFLAB_MODULES_SETTING . '[' . $module_slug . '][enabled]"', $output );
$this->assertContains( 'Enable ' . $module_data['name'] . ' <strong>(experimental)</strong>?', $output );
$this->assertContains( 'Enable ' . $module_data['name'] . ' <strong>(experimental)</strong>', $output );
$this->assertContains( " checked='checked'", $output );
}

Expand Down

0 comments on commit 50d740d

Please sign in to comment.