Freecodecamp: Incorrect Solution Passes Tests

Created on 24 Nov 2016  ·  4Comments  ·  Source: freeCodeCamp/freeCodeCamp

Challenge Import a Google Font has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36 Vivaldi/1.5.658.44.
Please describe how to reproduce this issue, and include links to screenshots if possible.

The instructions and tests for this challenge say that you should apply the Lobster font to the h2 element, but leave the p elements using Monospace.

So that implies that the correct solution is to create a selector that will target only the h2 elements:

<style>
  .red-text {
    color: red;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }

h2 {
    font-family: Lobster;
}
</style>

However, this code passes even though it also changes the font of the p elements to Lobster.

<style>
  .red-text {
    color: red;
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

Should we modify the tests so that there has to be a separate h2 selector?

help wanted

Most helpful comment

I'll take a crack at this. Been awhile since I made a contribution.

All 4 comments

Confirmed.

Wow! It also applies to the next challenge: Specify How Fonts Should Degrade

Good catch. Thanks @Margaret2 @Manish-Giri and @marhyorh.
Anyone up for fixing the tests on both challenges?

I'll take a crack at this. Been awhile since I made a contribution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FatKoala picture FatKoala  ·  5Comments

manicmarvin picture manicmarvin  ·  5Comments

lasjorg picture lasjorg  ·  4Comments

luongthomas picture luongthomas  ·  5Comments

TJBarrettJR picture TJBarrettJR  ·  4Comments