Skip to content

Commit 58d32f9

Browse files
committed
Add test for API Collection icon rendering in external references
Adds test to verify that articles with task groups from external references get collectionGroup role for correct icon display. The test is temporarily skipped until the fix is implemented in the next commit. rdar://135837611
1 parent 0b356e8 commit 58d32f9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Tests/SwiftDocCTests/Rendering/DocumentationContentRendererTests.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,26 @@ class DocumentationContentRendererTests: XCTestCase {
131131
]
132132
)
133133
}
134+
135+
func testRenderKindAndRoleForAPICollection() throws {
136+
throw XCTSkip("TDD: Temporarily disabled while implementing API Collection icon fix")
137+
138+
// Articles with task groups should get collectionGroup role for external references
139+
let apiCollectionSummary = LinkDestinationSummary(
140+
kind: .article,
141+
language: .swift,
142+
relativePresentationURL: URL(string: "/documentation/test/external/api-collection")!,
143+
referenceURL: URL(string: "doc://com.example.test/documentation/test/external/api-collection")!,
144+
title: "External API Collection",
145+
availableLanguages: [.swift],
146+
taskGroups: [LinkDestinationSummary.TaskGroup(title: "Symbols", identifiers: ["doc://com.example.test/symbol1"])],
147+
variants: []
148+
)
149+
150+
let (kind, role) = DocumentationContentRenderer.renderKindAndRole(.article, semantic: nil, linkSummary: apiCollectionSummary)
151+
XCTAssertEqual(kind, RenderNode.Kind.article)
152+
XCTAssertEqual(role, "collectionGroup")
153+
}
134154
}
135155

136156
private extension DocumentationDataVariantsTrait {

0 commit comments

Comments
 (0)