FreeCodeCamp ― Test Does Not Recognize Correct Solution

in #utopian-io6 years ago

This bug report discusses a code challenge on FreeCodeCamp.org that does not appear to be working correctly. When submitting the clearly expected answer the site rejects this answer and does not credit the user for a correct response.

The bug does not impact use of other challenges on the site, but prevents a user from fully completing one section of the free curriculum. This occurred using the Google Chrome browser on several devices. Other browsers were not tried.

Project Information

This issue was reported on the project owners repository here.
UPDATE: While doing a second pass of due diligence in the project's backlog I found this issue which raises the same behavior. However, the proposed solution did not work for me so I decided to go ahead and share what I already learned and had written up in the hopes that increased visibility might lead to an improved solution.

I understand that may make this post ineligible or lower quality as a Utopian contribution. That's a secondary concern. I'm hopeful that the information still proves useful to the project itself.

Expected behavior

When a correct solution to the exercise is entered in the code pane all the tests pass and the site acknowledges that the lesson is complete.

image.png

The instructions for this lesson read "[a]dd a height property to the h4 tag and set it to 25px." Thus the following code should pass. But does not.

<style>
  h4 {
    text-align: center;
    height: 25px;
  }
  p {
    text-align: justify;
  }
  .links {
    margin-right: 20px;
    text-align: left;
  }
  .fullCard {
    width: 245px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin: 10px 5px;
    padding: 4px;
  }
  .cardContent {
    padding: 10px;
  }
</style>
<div class="fullCard">
  <div class="cardContent">
    <h4>Google</h4>
    <div class="cardText">
      <p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.</p>
    </div>
    <div class="cardLinks">
      <a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a>
      <a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
    </div>
  </div>
</div>

Actual behavior

When the code above is tested, the lesson unit tests fail and report as follows:

// running tests
Your code should change the h4 height property to a value of 25 pixels.
// tests completed

First impression investigation of cause

It may be that the default user-agent style sheet is slightly modifying the final computed height value of the applicable element, causing the causing the actual height not to match the expected `height in the following described test.

freeCodeCamp/curriculum/challenges/english/01-responsive-web-design/applied-visual-design/adjust-the-height-of-an-element-using-the-height-property.english.md

tests:
  - text: Your code should change the <code>h4</code> <code>height</code> property to a value of 25 pixels.
    testString: assert($('h4').css('height') == '25px', 'Your code should change the <code>h4</code> <code>height</code> property to a value of 25 pixels.');

On inspection the computed value does come close to 25px. But it is not exact:

Screenshot 2018-12-11 at 18.22.35.png

How to reproduce

Operating system: Chrome OS v. 70.0.3538.110

  1. Navigate to https://learn.freecodecamp.org/responsive-web-design/applied-visual-design/adjust-the-height-of-an-element-using-the-height-property
  2. On line 4 of the code pane modify the h4 style by inserting height: 25px;
  3. Click the 'Run the Tests' button or press CTRL + ENTER to run the tests
  4. The tests should pass but don't.

Recording Of The Bug

free-code-camp-bug-1.gif
Link to full video: https://www.useloom.com/share/4895543830444027b427f067e76c6d1c

image.png
Inset view of code change

GitHub Account

https://github.com/tdreid
@tdre on the Steem blockchain

Sort:  

Hi @tdre,

Thanks for your contribution.

Although your contribution is well explained and goes into a good amount of detail, unfortunately, this contribution is not suitable for scoring due to the project not being listed on the Utopian Bug Hunting whitelist. If you didn't know, currently there is a whitelist that specifies projects that bug hunting contributions can be made to, this can be found here:

https://docs.google.com/spreadsheets/d/1S7ayFTEy5CBMyeJvFRgq5JUjlqZxFjWAWhhrBL0GC60/edit#gid=1954068373

Also, I see that you mention that the same behavior has already reported and therefore another reason this cannot be reviewed. With the above said, it's great to see that you're hoping to raise awareness of this issue by making a post. I hope this gets fixed in the near future.

Once again, thanks for your contribution and despite this unfortunate scenario, I hope to see your contributions in the future :)


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thanks for the feedback @tobias-g. I did not know about the whitelist for the bug category. I do not often submit contributions for @bug-hunting and so I just got lucky on the earlier ones. Thanks for informing of it. As I will want to make sure my own projects are whitelisted in addition to making sure bug reports are for white listed projects.

I appreciate your comments. Keep up the great work!

Thank you for your review, @tobias-g! Keep up the good work!

Calling @originalworks :)
img credz: pixabay.com
Nice, you got a 100.0% @reggaemuffin upgoat, thanks to @tdre
BuildTeam wishes everyone a great Christmas and bullish Holidays
Want a boost? Minnowbooster's got your back!

Baaaaaaaaaaaa! =)





This post has been voted on by the SteemSTEM curation team and voting trail in collaboration with @curie.

If you appreciate the work we are doing then consider voting both projects for witness by selecting stem.witness and curie!

For additional information please join us on the SteemSTEM discord and to get to know the rest of the community!

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.029
BTC 66989.78
ETH 3524.32
USDT 1.00
SBD 2.69