Error with the 'Run the tests' on Certification Project Survey Form?

Hello and apologies for deleting the thread I just wrote, the formatting went very strange on me and I couldn’t edit it. I’ll try again:

I am on the Responsive Web Design course, First Certification project, ‘Survey Form’, and I think there is an error, when you run the tests, with regards to what tests are correct. I tried to code the test 'Your #name should have a type of text but couldn’t remember how to code it so I made an educated guess and the test passed. However, I was fairly sure what I wrote was wrong, so I deleted it and ran tests… And test tells me my code for this is correct, even though I had deleted the code!

So then I added something random, on purpose, in the CSS (though maybe type of text should be in the HTML rather than the CSS actually, I need to research this as I forgot) but it is still telling me my code passed.

And also, I am not seeing anything weird in the preview, so my preview is also not telling me I am doing anything blatantly wrong. Is there an error in the tests?
And also, I THINK it’s not the first time I have this issue with the tests, as when I was about to type one of the earlier and easier codes, I am fairly sure the test told me my code was correct BEFORE I wrote anything at all… But as I was focusing, I didn’t take any notes of where I’d had this issue already. Oh and also, saving regularly or not saving progress makes no difference to that test telling me it’s passing even when left blank.

Any way someone from the site could look at this, because this isn’t just about my survey form seemingly looking all correct, but this is also meant to teach me how certain codes give certain results. While, if everything seems to pass all the time, I could end up learning the wrong syntax for some of what I am trying to code… Help?
Thank you very much! :slight_smile:

1 Like

Please post your actual code instead of a screenshot. Also, please post a link to the project. Thanks


When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Hi Jeremy,

That’s just it though, I didn’t write any code at all for that particular step as I was about to stop working when it happened: I saw it was telling me my code had passed when I had written nothing… so I have no code to show… But then typing something random, which was my second screenshot here, still told me my test passed… But I had written nothing initially, since I was about to clock off, when ‘Run the tests’ told me I was passing a step that I hadn’t written in.

Make it type="button" and run the tests.

It seems to default to text, so if you don’t put a type, it will be text. If I put something invalid like type="nothing" it’s still text (by default) in the preview and passes the test.

I confirmed this behaviour here:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input

So it’s not just this platform.

You have code in those screenshots. Please post that actual code instead of screenshots.

Are you saying that whatever boilerplate starter code is already present is already passing some tests?

That could be normal. I’ll double-check what’s supposed to be there and if it fulfills some tests already.

I have no code AT ALL for what’s supposed to be passing: didn’t complete it, was clocking off.

As I was saying to Jeremy, I have no code written for what’s supposed to be passing: tests seem to be anticipating, and telling me the next step, is correct, but I hadn’t written it down yet (and don’t know what I’m meant to write as I forgot, I need to research it to code it in properly).

The code is right here.

Am I not supposed to write anything for: ‘Your name should be a type of text’, like input type? Because I didn’t, as I thought: ‘I can’t remember how to do what they’re asking, I’ll do it later’. It’s the ‘Your name should be a type of text’ I am not seeing in my code…

You should, yes.

However, the test checks the type of the input. So if you don’t add any code, it defaults to text, which is correct and passes the test. You could fail this test by putting type=“button”.

Ah OK! That makes sense: so is it best practice to STILL write input type etc., generally, now, or am I not supposed to?

I see two pictures with code in them?

One picture shows my test was passing without me having written anything. The other one shows I typed something that doesn’t exist, on purpose, to see if my code still passed. pkdvalis is in the process of explaining though. :slight_smile:

I think the issue is that there is boilerplate code that passes the test already, before adding anything specific for that test. Is that correct @Judith83 ?

I don’t remember what boilerplate is already present for this project

OK… But does that mean that if I wrote something actually wrong, or say, corrected with an input type of button as you said, the test would then fail me? My worry was that the test was passing just about anything due to some bug… Because being a beginner, I am likely to make errors and not know if everything seems to pass. But if ‘by default without coding anything in’ options mark steps as passed, that’s interesting to know. And forgive this beginner, I am not familiar with the term ‘boilerplate’, but through context, I am guessing that it means any settings where ‘if you don’t code anything, the default sets itself by default’, then that makes sense…

I don’t think the survey form has any boilerplate at all. All the code we see on the screen was written by OP. The seed code is empty: freeCodeCamp/curriculum/challenges/english/14-responsive-web-design-22/build-a-survey-form-project/build-a-survey-form.md at main · freeCodeCamp/freeCodeCamp · GitHub

When you first started the project was there already some html code? That’s what I mean by boilerplate. Some starter code that’s already there to get you going or give you a structure to work in instead of starting from a blank page.

I noticed that, wasn’t sure if that was the only source. If there was boilerplate it should definitely be there?

Ok so you did write all that code, @Judith83 ?

Yep. The markdown file is what’s used to generate the page for users

1 Like