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 test to import and degrade font challenges #11829

Merged

Conversation

dhcodes
Copy link
Contributor

@dhcodes dhcodes commented Nov 26, 2016

Pre-Submission Checklist

  • Your pull request targets the staging branch of FreeCodeCamp.
  • Branch starts with either fix/, feature/, or translate/ (e.g. fix/signin-issue)
  • You have only one commit (if not, squash them into one commit).
  • All new and existing tests pass the command npm test. Use git commit --amend to amend any fixes.

Type of Change

  • Small bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Add new translation (feature adding new translations)

Checklist:

Description

Added a Regex test to ensure campers use the h2 selector when modifying fonts on challenges: Import a Google Font and Specify How Fonts Degrade.

@BerkeleyTrue BerkeleyTrue added the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Nov 26, 2016
Copy link
Member

@systimotic systimotic left a comment

Choose a reason for hiding this comment

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

Nice work @dhcodes!

@@ -1041,7 +1042,7 @@
],
"tests": [
"assert($(\"h2\").css(\"font-family\").match(/^\"?lobster/i), 'message: Your h2 element should use the font <code>Lobster</code>.');",
"assert($(\"h2\").css(\"font-family\").match(/lobster.*,.*monospace/i), 'message: Your h2 element should degrade to the font <code>Monospace</code> when <code>Lobster</code> is not available.');",
"assert(/\\s*?h2\\s*?\\{\\s*?font-family\\:\\s*?(\\'|\\\")?Lobster(\\'|\\\")?,\\s*?Monospace\\s*?\\;\\s*?\\}/gi.test(code), 'message: Your h2 element should degrade to the font <code>Monospace</code> when <code>Lobster</code> is not available.');",

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@@ -958,6 +958,7 @@
"tests": [
"assert(new RegExp(\"googleapis\", \"gi\").test(code), 'message: Import the <code>Lobster</code> font.');",
"assert($(\"h2\").css(\"font-family\").match(/lobster/i), 'message: Your <code>h2</code> element should use the font <code>Lobster</code>.');",
"assert(/\\s*?h2\\s*?\\{\\s*?font-family\\:\\s*?(\\'|\\\")?Lobster(\\'|\\\")?\\s*?\\;\\s*?\\}/gi.test(code), 'message: Use an <code>h2</code> CSS selector to change the font.');",

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@dhcodes dhcodes force-pushed the fix/improved-tests-import-font branch from 7d0f626 to 544dd57 Compare November 27, 2016 03:55
@camperbot
Copy link
Contributor

@dhcodes updated the pull request.

1 similar comment
@camperbot
Copy link
Contributor

@dhcodes updated the pull request.

@dhcodes dhcodes force-pushed the fix/improved-tests-import-font branch from 544dd57 to 84a03a1 Compare November 27, 2016 04:03
@camperbot
Copy link
Contributor

@dhcodes updated the pull request.

@dhcodes dhcodes force-pushed the fix/improved-tests-import-font branch from 84a03a1 to e3cda17 Compare November 27, 2016 04:05
@Bouncey
Copy link
Member

Bouncey commented Nov 27, 2016

LGMT 👍

@Bouncey Bouncey merged commit 2a526fc into freeCodeCamp:staging Nov 27, 2016
@BerkeleyTrue BerkeleyTrue removed the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Nov 27, 2016
@ooade
Copy link

ooade commented Nov 27, 2016

@dhcodes This is nice, i also thought about this approach concerning the Firefox issues cos i've looked more into the selector.css method but no luck on firefox, maybe because of React's Virtual DOM.

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.

None yet

6 participants