-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: version idx 0 is rendering twice
- Loading branch information
1 parent
2221a87
commit 0eb140f
Showing
3 changed files
with
78 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,30 @@ | ||
import { DocsV2Read } from "@fern-api/fdr-sdk"; | ||
import fs from "fs"; | ||
import path from "path"; | ||
import { getNavigationRoot } from "../getNavigationRoot"; | ||
import { testGetAllUrlsFromDocsConfig } from "./testGetAllUrlsFromDocsConfig"; | ||
|
||
describe("getAllUrlsFromDocsConfig", () => { | ||
testGetAllUrlsFromDocsConfig("primer"); | ||
}); | ||
|
||
describe("getNavigationRoot", () => { | ||
describe("primer", () => { | ||
it("gets navigation root for /docs/api/introduction/getting-started", async () => { | ||
const fixturePath = path.join(__dirname, "fixtures", "primer.json"); | ||
|
||
const content = fs.readFileSync(fixturePath, "utf-8"); | ||
|
||
const fixture = JSON.parse(content) as DocsV2Read.LoadDocsForUrlResponse; | ||
|
||
const urls = getNavigationRoot( | ||
"docs/api/introduction/getting-started".split("/"), | ||
fixture.baseUrl.basePath, | ||
fixture.definition.config.navigation, | ||
fixture.definition.apis, | ||
); | ||
|
||
expect(urls?.type === "found" ? urls.found.versions : []).toMatchSnapshot(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters