freeCodeCamp / curriculum

The freeCodeCamp curriculum and lesson editor
Creative Commons Attribution Share Alike 4.0 International
81 stars 124 forks source link

fix(challenges): add missing test to check for css class #258

Closed Nirajn2311 closed 6 years ago

Nirajn2311 commented 6 years ago

ISSUES CLOSED: #254

Description

I have added the below test

        {
          "text":
            "Define a class named <code>silver-background</code> within the <code>style</code> element and assign the value of <code>silver</code> to the <code>background-color</code> property.",
          "testString":
            "assert(code.match(/\\.silver-background\\s*{\\s*background-color:\\s*silver;\\s*}/), \"Define a class named <code>silver-background</code> within the <code>style</code> element and assign the value of <code>silver</code> to the <code>background-color</code> property.\");"
        }

The test checks if there is a silver-background class in the style element and makes the sure the below code doesn't pass the test.

  div { /* This should not pass the tests */
    background-color: silver;
  }

Pre-Submission Checklist

Checklist:

Closes #254

scissorsneedfoodtoo commented 6 years ago

@Nirajn2311, thank you for this fix! Merging now.

And thank you for helping to QA this, @joshalling.