Product landing page issue -error on User Story #5:

I am having the problem. please tell me how to solve
at below User Story#5 , I am getting error while testing my code at this User Story#5.

User Story #5: When I click a .nav-link button in the nav element, I am taken to the corresponding section of the landing page.

Below is how it showing error:

The .nav-link with href="#infoLinks" is not linked to a corresponding element on the page : expected null to not equal null
AssertionError: The .nav-link with href="#infoLinks" is not linked to a corresponding element on the page : expected null to not equal null
at Proxy.c (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:549:1889)
at Proxy.l (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:431:130)
at Function.n.isNotNull (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:574:1549)
at https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:657:142799
at NodeList.forEach ()
at a. (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:657:142605)
at https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:36606
at i.p.run (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:36901)
at N.runTest (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:42814)
at https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:43780

Here is my CodePen

You don’t have an element with id="infoLinks" on your page, so that nav-link won’t take you anywhere.

Thank you so much
It’s working now :grinning:

1 Like

Nice work! Looks like you pass all of the tests! I’d continue to work on the layout and site design until you’ve made it truly yours. :slightly_smiling_face:

Hi,

Would you be able to help with below ,
I’m working on the Personal Portfolio project, and I have issue at User Story#7 ,it showing yellow flag errors, I’m not sure how to fix.

User Story #7: The navbar should contain at least one link that I can click on to navigate to different sections of the page

Here is my CodePen


I show you complete all tests. :upside_down_face:

Thanks for confirming :slight_smile: I saw #7 turning yellow for sometime and then showing as passed so I thought it might has some issue. Glad you were able to clarify all passed!

Understand the Hazards of Using Imperative Code

finalTabs.tabs should be ['FB', 'Gitter', 'Reddit', 'Twitter', 'Medium', 'new tab', 'Netflix', 'YouTube', 'Vine', 'GMail', 'Work mail', 'Docs', 'freeCodeCamp', 'new tab']

I got an answer as shown below , but I am missing the word ‘Vine’ Would you be able to help me please.

[ ‘FB’,
‘Gitter’,
‘Reddit’,
‘Twitter’,
‘Medium’,
‘new tab’,
‘Netflix’,
‘YouTube’,
‘GMail’,
‘Work mail’,
‘Docs’,
‘freeCodeCamp’,
‘new tab’ ]

Here is my Code:
// tabs is an array of titles of each site open within the window

var Window = function(tabs) {

this.tabs = tabs; // We keep a record of the array inside the object

};

// When you join two windows into one window

Window.prototype.join = function (otherWindow) {

this.tabs = this.tabs.concat(otherWindow.tabs);

return this;

};

// When you open a new tab at the end

Window.prototype.tabOpen = function (tab) {

this.tabs.push(‘new tab’); // Let’s open a new tab for now

return this;

};

// When you close a tab

Window.prototype.tabClose = function (index) {

// Only change code below this line

var tabsBeforeIndex = this.tabs.splice(0, index); // Get the tabs before the tab

var tabsAfterIndex = this.tabs.splice(index); // Get the tabs after the tab

this.tabs = tabsBeforeIndex.concat(tabsAfterIndex); // Join them together

// Only change code above this line

return this;

};

// Let’s create three browser windows

var workWindow = new Window([‘GMail’, ‘Inbox’, ‘Work mail’, ‘Docs’, ‘freeCodeCamp’]); // Your mailbox, drive, and other work sites

var socialWindow = new Window([‘FB’, ‘Gitter’, ‘Reddit’, ‘Twitter’, ‘Medium’]); // Social sites

var videoWindow = new Window([‘Netflix’, ‘YouTube’, ‘Vimeo’, ‘Vine’]); // Entertainment sites

// Now perform the tab opening, closing, and other operations

var finalTabs = socialWindow

.tabOpen() // Open a new tab for cat memes

.join(videoWindow.tabClose(2)) // Close third tab in video window, and join

.join(workWindow.tabClose(1).tabOpen());

console.log(finalTabs.tabs);