Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Oct 9, 2023
1 parent 7da7e50 commit d94c5bf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/MjmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@
Mjml::new()->sidecar()->toHtml(mjmlSnippet());
})->throws(SidecarPackageUnavailable::class);

it('can determine if the given mjml can be converted when the mjml is deprecated', function (string $mjml, bool $expectedResult) {
expect(Mjml::new()->canConvert($mjml))->toBe($expectedResult);
})->with([
['<mjml><mj-body></mj-body></mjml>', true],
['<mjml><mj-body><mj-container></mj-container></mj-body></mjml>', false], // deprecated mjml
['<mjml><mj-body><mj-wrapper></mj-wrapper></mj-body></mjml>', true],
]);

function mjmlSnippet(): string
{
return <<<'MJML'
Expand Down

0 comments on commit d94c5bf

Please sign in to comment.