Technical documentation user story problems

I am experiencing several user story errors. For example user story 4:

. Each element with the class of “main-section” should also have an id comprised of the innerText contained within it, with underscores in place of spaces. The id may include special characters if there are special characters in the respective innerText. (e.g. The that contains the header, “JavaScript & Java”, should have a corresponding id=“JavaScript_&_Java”).

However I have checked the id’s and the corresponding header titles and they are the same. I am not sure what I am needing to fix these errors. It is the same with the other user stories, I am unsure why they are failing.

additionally, I have also tried to make a dark-mode button using some JavaScript. It is targeting the body element. It worked at the start before I added the CSS, but now it is not working and I am not sure why. Any pointers would really help.

Thanks in advance.

Edit: Forgot to put link: :man_facepalming:

https://codepen.io/mcfeegles/pen/wvzadMm

Can we see your code please?

Yes sorry I copied the link to the clipboard, just forgot to paste into the post. Sorry

1 Like

The part of the error message that you quote has general example at the end. If you look further, there is specific information:

Some “main-section” elements are missing the following ids (don’t forget to replace spaces with underscores!) : GLOBAL_VARIABLES,COSTANTS,FUNCTION_DECLARATION : expected 3 to equal 0
AssertionError: Some “main-section” elements are missing the following ids (don’t forget to replace spaces with underscores!) : GLOBAL_VARIABLES,COSTANTS,FUNCTION_DECLARATION : expected 3 to equal 0

When I look at the sections for Global Variables, I see:

       <li> <a class="nav-link" href="#Global_Variable">
           Global Variable
       </li>

and:

     <section class="main-section" id="Global_Variable">
       <header>Global Variables</header>

Sometimes it is plural, sometimes it is not. Those should all match.

Ahh Thanks, for that now I understand a bit better in how to read the error messages. Definitely learning that coding hates typo’s and spelling mistakes.

1 Like