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

Write test for BlogPostPreview::sendPreview() #203

Merged
merged 4 commits into from
Aug 18, 2023

Conversation

spaze
Copy link
Owner

@spaze spaze commented Aug 17, 2023

To avoid all blog post preview errors. This test successfully detects all the issues reported in #169.

…mplate()` call

It still works even if not passed, because it uses `getTemplate()` inside but let's be explicit.
To avoid all blog post preview errors. This test successfully detects all the issues reported in #169.
…e repository checkout

There are some hardcoded paths in the config that are hard to change and are needed for rendering the blog post template:
- SRI extension path to CSS, JS etc.
- SVG icons paths

These could be set/overwritten in the test with

```php
$this->sriConfig->setLocalPrefix((object)['path' => __DIR__ . '/../../../public/www.michalspacek.cz']);
PrivateProperty::setValue($this->svgIconNodeFactory, 'iconsDir', __DIR__ . '/../../../node_modules/humbleicons/icons');
```
But then you get "Cannot modify readonly property Spaze\SvgIcons\Nodes\IconNodeFactory::$iconsDir"

Creating a custom template where neither SRI nor SVG icons are needed would be possible but then things like "Component with name 'articleHeaderIcons' does not exist" from #169 would not be tested.
@spaze spaze self-assigned this Aug 17, 2023
@spaze spaze merged commit c88e73b into main Aug 18, 2023
54 checks passed
@spaze spaze deleted the spaze/blog-post-preview-test branch August 18, 2023 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant