Personal Portfolio Test 7 not passing, timeout problem

Personal Portfolio Test 7 not passing, timeout problem
0

I made my code as barebones as possible and test 7 is not passing. I get timeout.

Response:

  1. The navbar should contain at least one link that I can click on to navigate to different sections of the page. Error: timeout of 10000ms exceeded. Ensure the done() callback is being called in this test.
    at https://cdnjs.cloudflare.com/ajax/libs/mocha/3.0.2/mocha.min.js:2:7197

Anyone know what I did wrong?

Testing browser is Chrome.

<body>
  <nav id="navbar">
    <a href="#about">about</a>
  </nav>
  <main>
    <section id="about">
      Test
    </section>
  </main>
</body>

So I think I found the problem.

The test does not pass if the the page does not move on link click.

Solution is too make at least one section so big that clicking on a link will move the page.

I think test is bugged.

Below code test 7 passes.

<style>
    section { height: 100vh; }
</style>
<body>
  <nav id="navbar">
    <a href="#about">about</a>
    <a href="#about">projects</a>
  </nav>
  <main>
    <section id="about">
      Test
    </section>
    <section id="projects">
      Test
    </section>
  </main>
</body>
1 Like

Thanks for your solution, the test is buggy. :exploding_head:

I have the same problem with passing the test no 7 - I got a message:
The navbar should contain at least one link that I can click on to navigate to different sections of the page.
At least one navbar link should move the page position when clicked : expected false to be true
[email protected]https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:139:475

I can see that the script is clicking on the links in navbar and the page is moving up and down but for some reason the test fails.

To fix the position of the navbar I am using the grid layout with navbar taking fixed height on top of the viewport and the rest of the viewport is one row with vertical scrollbar and this that row contains other sections: about, projects and contact.

I think that because my navbar is a part of the flow of the page (is not fixed) the test fails. Can anyone confirm that? What should I do? Is navbars position: fixed mandatory to pass the test - in my opinion my solution with grid layout is better