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 tests for the head component #923

Merged
merged 25 commits into from
Feb 5, 2023
Merged

Add tests for the head component #923

merged 25 commits into from
Feb 5, 2023

Conversation

caendesilva
Copy link
Member

This component is pretty important, so we might as well have some tests for it!

@codecov
Copy link

codecov bot commented Feb 5, 2023

Codecov Report

Merging #923 (e98b44c) into master (427e8ac) will not change coverage.
The diff coverage is n/a.

@@              Coverage Diff              @@
##              master      #923     +/-   ##
=============================================
  Coverage     100.00%   100.00%             
- Complexity      1237      2474   +1237     
=============================================
  Files            145       290    +145     
  Lines           3269      6538   +3269     
=============================================
+ Hits            3269      6538   +3269     
Impacted Files Coverage Δ
...ork/src/Markdown/Processing/ShortcodeProcessor.php 100.00% <0.00%> (ø)
...ramework/src/Console/Commands/BuildSiteCommand.php 100.00% <0.00%> (ø)
...es/framework/src/Framework/HydeServiceProvider.php 100.00% <0.00%> (ø)
...Markdown/Processing/CodeblockFilepathProcessor.php 100.00% <0.00%> (ø)
.../framework/src/Framework/Services/BuildService.php 100.00% <0.00%> (ø)
...ckages/framework/src/Foundation/PageCollection.php 100.00% <0.00%> (ø)
...amework/src/Framework/Services/MarkdownService.php 100.00% <0.00%> (ø)
...ework/src/Console/Commands/PublishViewsCommand.php 100.00% <0.00%> (ø)
...ork/Features/Metadata/Elements/MetadataElement.php 100.00% <0.00%> (ø)
.../src/Framework/Factories/NavigationDataFactory.php 100.00% <0.00%> (ø)
... and 135 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@caendesilva caendesilva marked this pull request as ready for review February 5, 2023 19:55
@caendesilva caendesilva merged commit e796bb9 into master Feb 5, 2023
@caendesilva caendesilva deleted the update-head-component branch February 5, 2023 19:55
@what-the-diff
Copy link

what-the-diff bot commented Feb 5, 2023

  • Added a new test file
  • Created the HeadComponentViewTest class and extended it from TestCase
  • Defined setUp() method to mock page object using Hyde::mockPage() function
  • Defined renderTestView() method which renders head component view by calling Blade facade's render method with escaped includes of vendor path resources/views/layouts/head blade template as argument
  • Wrote 5 tests for testing different scenarios like rendering meta tags, title element uses htmlTitle property of Page model, link to favicon is not added when file does not exist etc...

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.

2 participants