diff --git a/packages/cli/src/data/schema/graph.js b/packages/cli/src/data/schema/graph.js index 1c1c51a27..40509ff3d 100644 --- a/packages/cli/src/data/schema/graph.js +++ b/packages/cli/src/data/schema/graph.js @@ -129,7 +129,7 @@ const getChildrenFromParentRoute = async (root, query, context) => { const { label } = getDeriveMetaFromRoute(route); const root = route.split('/')[1]; - if (root.indexOf(parent) >= 0) { + if (root.indexOf(parent) >= 0 && page.fileName !== 'index') { const id = page.label; pages.push({ diff --git a/packages/cli/test/unit/data/schema/graph.spec.js b/packages/cli/test/unit/data/schema/graph.spec.js index 3448ec8a2..c33792d65 100644 --- a/packages/cli/test/unit/data/schema/graph.spec.js +++ b/packages/cli/test/unit/data/schema/graph.spec.js @@ -39,25 +39,22 @@ describe('Unit Test: Data', function() { }); it('should have 8 children', function() { - expect(children.length).to.equal(8); + expect(children.length).to.equal(7); }); it('should have the expected value for id for each child', function() { expect(children[0].id).to.equal('css-components'); expect(children[1].id).to.equal('deploy'); expect(children[2].id).to.equal('create-content'); - expect(children[3].id).to.equal('getting-started'); - expect(children[4].id).to.equal('concepts'); - expect(children[5].id).to.equal('next'); - expect(children[6].id).to.equal('project-setup'); - expect(children[7].id).to.equal('start'); + expect(children[3].id).to.equal('concepts'); + expect(children[4].id).to.equal('next'); + expect(children[5].id).to.equal('project-setup'); + expect(children[6].id).to.equal('start'); }); it('should have the expected filePath for each child', function() { children.forEach(function(child) { - const path = child.fileName === 'index' ? '' : child.fileName; - - expect(child.link).to.equal(`/getting-started/${path}`); + expect(child.link).to.equal(`/getting-started/${child.fileName}`); }); }); @@ -65,11 +62,10 @@ describe('Unit Test: Data', function() { expect(children[0].fileName).to.equal('branding'); expect(children[1].fileName).to.equal('build-and-deploy'); expect(children[2].fileName).to.equal('creating-content'); - expect(children[3].fileName).to.equal('index'); - expect(children[4].fileName).to.equal('key-concepts'); - expect(children[5].fileName).to.equal('next-steps'); - expect(children[6].fileName).to.equal('project-setup'); - expect(children[7].fileName).to.equal('quick-start'); + expect(children[3].fileName).to.equal('key-concepts'); + expect(children[4].fileName).to.equal('next-steps'); + expect(children[5].fileName).to.equal('project-setup'); + expect(children[6].fileName).to.equal('quick-start'); }); it('should have the expected link for each child', function() { @@ -88,11 +84,10 @@ describe('Unit Test: Data', function() { expect(children[0].title).to.equal('Styles and Web Components'); expect(children[1].title).to.equal('Build and Deploy'); expect(children[2].title).to.equal('Creating Content'); - expect(children[3].title).to.equal('Getting Started'); - expect(children[4].title).to.equal('Key Concepts'); - expect(children[5].title).to.equal('Next Steps'); - expect(children[6].title).to.equal('Project Setup'); - expect(children[7].title).to.equal('Quick Start'); + expect(children[3].title).to.equal('Key Concepts'); + expect(children[4].title).to.equal('Next Steps'); + expect(children[5].title).to.equal('Project Setup'); + expect(children[6].title).to.equal('Quick Start'); }); it('should have expected custom front matter data if it is set', function() {