Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Twenty Twenty-Two theme to list of Reader Themes #6870

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/images/reader-themes/twentytwentytwo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions includes/sanitizers/class-amp-core-theme-sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
* @var array
*/
protected static $supported_themes = [
'twentytwentytwo',
'twentytwentyone',
'twentytwenty',
'twentynineteen',
Expand Down Expand Up @@ -82,6 +83,11 @@
*/
protected static function get_theme_features_config( $theme_slug, $args = [] ) {
switch ( $theme_slug ) {
// Twenty Twenty-Two.
case 'twentytwentytwo':
return [];

Check warning on line 88 in includes/sanitizers/class-amp-core-theme-sanitizer.php

View check run for this annotation

Codecov / codecov/patch

includes/sanitizers/class-amp-core-theme-sanitizer.php#L87-L88

Added lines #L87 - L88 were not covered by tests

// Twenty Twenty-One.
case 'twentytwentyone':
$config = [
'dequeue_scripts' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/specs/amp-onboarding/reader-themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe( 'Reader themes', () => {

it( 'main components exist with no selection', async () => {
const itemCount = await page.$$eval( '.theme-card', ( els ) => els.length );
expect( itemCount ).toBe( 11 );
expect( itemCount ).toBe( 12 );

await expect( page ).not.toMatchElement( 'input[type="radio"]:checked' );
await testNextButton( { text: 'Next', disabled: true } );
Expand Down
1 change: 1 addition & 0 deletions tests/php/test-class-amp-core-theme-sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public function test_get_closest_submenu( $dom, $element, $expected ) {
*/
public function test_get_supported_themes() {
$supported_themes = [
'twentytwentytwo',
'twentytwentyone',
'twentytwenty',
'twentynineteen',
Expand Down