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
add test to import and degrade font challenges #11829
Conversation
There was a problem hiding this 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.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -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.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
7d0f626
to
544dd57
Compare
@dhcodes updated the pull request. |
1 similar comment
@dhcodes updated the pull request. |
544dd57
to
84a03a1
Compare
@dhcodes updated the pull request. |
84a03a1
to
e3cda17
Compare
LGMT 👍 |
@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. |
Pre-Submission Checklist
staging
branch of FreeCodeCamp.fix/
,feature/
, ortranslate/
(e.g.fix/signin-issue
)npm test
. Usegit commit --amend
to amend any fixes.Type of Change
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.