Skip to content

Commit

Permalink
fix: remove 'overview' from toc (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaball35 authored Sep 21, 2021
1 parent 955a40c commit 72ae623
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public TocContents(String projectName, List<TocItem> items) {
private void createTocContents(String projectName, List<TocItem> items) {
List<Object> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,15 @@ public void getContentsWithProjectName() {
assertEquals(contents.getName(), "google-cloud-project");

List<Object> 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
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 72ae623

Please sign in to comment.