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

fix: Add support for renderable Arrays of strings #275

Merged
merged 2 commits into from
May 9, 2017
Merged

Conversation

doctyper
Copy link
Contributor

@doctyper doctyper commented May 4, 2017

Fixes #272

@codecov
Copy link

codecov bot commented May 4, 2017

Codecov Report

Merging #275 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #275      +/-   ##
==========================================
+ Coverage   98.91%   98.92%   +<.01%     
==========================================
  Files           3        3              
  Lines         277      278       +1     
==========================================
+ Hits          274      275       +1     
  Misses          3        3
Impacted Files Coverage Δ
src/Helmet.js 100% <100%> (ø) ⬆️
src/HelmetUtils.js 98.57% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a39211b...4114943. Read the comment docs.

@@ -46,6 +46,23 @@ describe("Helmet - Declarative API", () => {
});
});

it("updates page title and allows children containing expressions", (done) => {
const someValue = "Some Great Title";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have a test for const someValue = null too?

@@ -187,7 +187,13 @@ const Helmet = (Component) => class HelmetWrapper extends React.Component {
return warn(`Only elements types ${VALID_TAG_NAMES.join(", ")} are allowed. Helmet does not support rendering <${child.type}> elements. Refer to our API for more information.`);
}

if (nestedChildren && typeof nestedChildren !== "string") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion. Externalize the test into a function. That would make the code more declarative and easier to read on first glance and communicate better intent of the code.

@cwelch5 cwelch5 self-requested a review May 4, 2017 18:08
@cwelch5 cwelch5 merged commit aad5457 into master May 9, 2017
@tmbtech tmbtech deleted the issue-272 branch May 1, 2019 00:53
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.

5 participants