From 72ae623953d088ab3d0705a5791641c850f255c4 Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Tue, 21 Sep 2021 11:44:46 -0700 Subject: [PATCH] fix: remove 'overview' from toc (#65) --- .../main/java/com/microsoft/model/TocContents.java | 1 - .../java/com/microsoft/model/TocContentsTest.java | 13 +++++-------- .../test/resources/expected-generated-files/toc.yml | 2 -- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocContents.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocContents.java index e8dfe2d0..4ee95c89 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocContents.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocContents.java @@ -37,7 +37,6 @@ public TocContents(String projectName, List items) { private void createTocContents(String projectName, List items) { List tocItems = new ArrayList<>(); // combine guides and tocItems - tocItems.add(new Guide("Overview", "index.md")); tocItems.add(new Guide("Version history", "history.md")); tocItems.addAll(items); // wrap guides + tocItems with product hierarchy diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocContentsTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocContentsTest.java index 2dc075e6..63d50d25 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocContentsTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocContentsTest.java @@ -56,18 +56,15 @@ public void getContentsWithProjectName() { assertEquals(contents.getName(), "google-cloud-project"); List items = contents.getItems(); - assertEquals("Should be 5 items", items.size(), 5); + assertEquals("Should be 4 items", items.size(), 4); assertEquals("Guide should be first", items.get(0).getClass(), Guide.class); - Guide overview = (Guide) items.get(0); - assertEquals("First guide should be Overview", overview.getName(), "Overview"); - assertEquals("Guide should be second", items.get(1).getClass(), Guide.class); - Guide history = (Guide) items.get(1); + Guide history = (Guide) items.get(0); assertEquals("Second guide should be Version History", history.getName(), "Version history"); - assertEquals("Item A should be second", items.get(2), tocItemA); - assertEquals("Item B should be third", items.get(3), tocItemB); - assertEquals("Item C should be fourth", items.get(4), tocItemC); + assertEquals("Item A should be second", items.get(1), tocItemA); + assertEquals("Item B should be third", items.get(2), tocItemB); + assertEquals("Item C should be fourth", items.get(3), tocItemC); } @Test diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/toc.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/toc.yml index 53e8ddf9..7b310cdb 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/toc.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/toc.yml @@ -1,8 +1,6 @@ ### YamlMime:TableOfContent - name: "google-cloud-project" items: - - name: "Overview" - href: "index.md" - name: "Version history" href: "history.md" - uid: "com.microsoft.samples"