-
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 missing eyebrow headers in markdown pages (#211)
* Add a reference to section from page node * Add sectionTitle to resolved path
- Loading branch information
Showing
10 changed files
with
83 additions
and
39 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
50 changes: 50 additions & 0 deletions
50
packages/commons/app-utils/src/path-resolver/__test__/PathResolver/nodes.test.ts
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { PathResolver } from "../../PathResolver"; | ||
import { expectDocsSection, expectPageNode } from "../util"; | ||
import { DEFINITION_UNVERSIONED_TABBED } from "./mock-definitions/unversioned-tabbed"; | ||
import { DEFINITION_UNVERSIONED_UNTABBED } from "./mock-definitions/unversioned-untabbed"; | ||
import { DEFINITION_VERSIONED_TABBED } from "./mock-definitions/versioned-tabbed"; | ||
import { DEFINITION_VERSIONED_UNTABBED } from "./mock-definitions/versioned-untabbed"; | ||
|
||
describe("resolveNavigatable", () => { | ||
describe("correctly gets the section associated with page", () => { | ||
it("with unversioned and untabbed docs", () => { | ||
const resolver = new PathResolver({ | ||
definition: DEFINITION_UNVERSIONED_UNTABBED, | ||
}); | ||
const node = resolver.rootNavigatable; | ||
expectPageNode(node); | ||
expectDocsSection(node.section); | ||
expect(node.section.title).toBe("Introduction"); | ||
}); | ||
|
||
it("with unversioned and tabbed docs", () => { | ||
const resolver = new PathResolver({ | ||
definition: DEFINITION_UNVERSIONED_TABBED, | ||
}); | ||
const node = resolver.resolveNavigatable("welcome/advanced-concepts/sharding"); | ||
expectPageNode(node); | ||
expectDocsSection(node.section); | ||
expect(node.section.title).toBe("Advanced Concepts"); | ||
}); | ||
|
||
it("with versioned and untabbed docs", () => { | ||
const resolver = new PathResolver({ | ||
definition: DEFINITION_VERSIONED_UNTABBED, | ||
}); | ||
const node = resolver.resolveNavigatable("v1-2/introduction/authentication"); | ||
expectPageNode(node); | ||
expectDocsSection(node.section); | ||
expect(node.section.title).toBe("Welcome"); | ||
}); | ||
|
||
it("with versioned and tabbed docs", () => { | ||
const resolver = new PathResolver({ | ||
definition: DEFINITION_VERSIONED_TABBED, | ||
}); | ||
const node = resolver.resolveNavigatable("help-center/documents/uploading-documents"); | ||
expectPageNode(node); | ||
expectDocsSection(node.section); | ||
expect(node.section.title).toBe("Documents"); | ||
}); | ||
}); | ||
}); |
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
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
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
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
4e496a2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
fern-dev – ./packages/ui/fe-bundle
fern-dev-git-main-buildwithfern.vercel.app
fern-dev-buildwithfern.vercel.app
app-dev.buildwithfern.com
devtest.buildwithfern.com