fixup!: build(docs-infra): Ensures that only member docs are linked (#36316)

PR Close #36316
This commit is contained in:
Sonu Kapoor 2020-04-14 12:53:28 -04:00 committed by Matias Niemelä
parent 7842f73e8b
commit 46ff673192
1 changed files with 11 additions and 3 deletions

View File

@ -137,12 +137,20 @@ describe('autoLinkCode post-processor', () => {
it('should ignore documents when the `docType` is set to `member` and the keyword doesn\'t include `.`',
() => {
aliasMap.addDoc({docType: 'class', id: 'MyClass', aliases: ['MyClass'], path: 'a/b/myclass'});
aliasMap.addDoc(
{docType: 'member', id: 'MyEnum', aliases: ['MyEnum'], path: 'a/b/c'});
const doc = {docType: 'test-doc', renderedContent: '<code>MyClass</code>'};
const doc = {docType: 'test-doc', renderedContent: '<code>MyEnum</code>'};
processor.$process([doc]);
expect(doc.renderedContent).toEqual('<code><a href="a/b/myclass" class="code-anchor">MyClass</a></code>');
expect(doc.renderedContent).toEqual('<code>MyEnum</code>');
});
it('should insert anchors when the `docType` is set to `member` and the keyword includes `.`',
() => {
aliasMap.addDoc(
{docType: 'member', id: 'MyEnum', aliases: ['MyEnum.Value'], path: 'a/b/c'});
const doc = {docType: 'test-doc', renderedContent: '<code>MyEnum.Value</code>'};
processor.$process([doc]);
expect(doc.renderedContent).toEqual('<code><a href="a/b/c" class="code-anchor">MyEnum.Value</a></code>');
});
it('should insert anchors for individual text nodes within a code block', () => {