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

Re-enable the Spec tests for server side rendered amp-audio #528

Merged
merged 2 commits into from
Jun 29, 2022
Merged
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
2 changes: 0 additions & 2 deletions tests/Optimizer/SpecTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ final class SpecTest extends TestCase
'ReorderHead - preserves_amp_custom_style_order' => 'see https://github.com/ampproject/amp-toolbox/issues/604',

'MinifyHtml - minifies_inline_amp-script' => 'see https://github.com/ampproject/amp-toolbox-php/issues/260',

'ServerSideRendering - does_not_transform_amp_audio' => 'The amp-toolbox needs to implement SSR amp-audio',
];

const CLASS_SKIP_TEST = '__SKIP__';
Expand Down
16 changes: 8 additions & 8 deletions tests/Optimizer/Transformer/ServerSideRenderingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,18 +321,18 @@ public function dataTransform()
],

'server side render amp-audio' => [
$input('<amp-audio src="http://example.com/audio.mp3" width="300"></amp-audio>'),
$expectWithoutBoilerplate('<amp-audio src="http://example.com/audio.mp3" width="300"><audio controls></audio></amp-audio>'),
$input('<amp-audio src="https://example.com/audio.mp3" width="300"></amp-audio>'),
$expectWithoutBoilerplate('<amp-audio src="https://example.com/audio.mp3" width="300"><audio controls></audio></amp-audio>'),
],

'ssr amp-audio appends audio element' => [
$input(
'<amp-audio src="http://example.com/audio.mp3" width="300">'
'<amp-audio src="https://example.com/audio.mp3" width="300">'
. '<div fallback="">Your browser doesn’t support HTML5 audio</div>'
. '</amp-audio>'
),
$expectWithoutBoilerplate(
'<amp-audio src="http://example.com/audio.mp3" width="300">'
'<amp-audio src="https://example.com/audio.mp3" width="300">'
. '<div fallback="">Your browser doesn’t support HTML5 audio</div>'
. '<audio controls></audio>'
. '</amp-audio>'
Expand All @@ -341,15 +341,15 @@ public function dataTransform()

'skip ssr amp-audio if audio child node is present' => [
$input(
'<amp-audio src="http://example.com/audio.mp3" width="300">'
'<amp-audio src="https://example.com/audio.mp3" width="300">'
. '<div fallback="">Your browser doesn’t support HTML5 audio</div>'
. '<audio controls src="http://example.com/audio.mp3"></audio>'
. '<audio controls src="https://example.com/audio.mp3"></audio>'
. '</amp-audio>'
),
$expectWithoutBoilerplate(
'<amp-audio src="http://example.com/audio.mp3" width="300">'
'<amp-audio src="https://example.com/audio.mp3" width="300">'
. '<div fallback="">Your browser doesn’t support HTML5 audio</div>'
. '<audio controls src="http://example.com/audio.mp3"></audio>'
. '<audio controls src="https://example.com/audio.mp3"></audio>'
. '</amp-audio>'
),
]
Expand Down