diff --git a/src/components/ContentNode.vue b/src/components/ContentNode.vue index 17807d9a1..fd9bab5a4 100644 --- a/src/components/ContentNode.vue +++ b/src/components/ContentNode.vue @@ -1,7 +1,7 @@ + + + diff --git a/tests/unit/components/ContentNode.spec.js b/tests/unit/components/ContentNode.spec.js index ced84b1b3..337bd3e19 100644 --- a/tests/unit/components/ContentNode.spec.js +++ b/tests/unit/components/ContentNode.spec.js @@ -1,7 +1,7 @@ /** * This source file is part of the Swift.org open source project * - * Copyright (c) 2021-2023 Apple Inc. and the Swift project authors + * Copyright (c) 2021-2024 Apple Inc. and the Swift project authors * Licensed under Apache License v2.0 with Runtime Library Exception * * See https://swift.org/LICENSE.txt for license information @@ -31,6 +31,7 @@ import TaskList from 'docc-render/components/ContentNode/TaskList.vue'; import { TopicSectionsStyle } from '@/constants/TopicSectionsStyle'; import LinksBlock from '@/components/ContentNode/LinksBlock.vue'; import DeviceFrame from '@/components/ContentNode/DeviceFrame.vue'; +import ThematicBreak from 'docc-render/components/ContentNode/ThematicBreak.vue'; const { TableHeaderStyle, TableColumnAlignments } = ContentNode.constants; @@ -1820,6 +1821,14 @@ describe('ContentNode', () => { }); }); + describe('with type="thematicBreak"', () => { + it('renders a `ThematicBreak`', () => { + const wrapper = mountWithItem({ type: ContentNode.BlockType.thematicBreak }); + const tbreak = wrapper.find(ThematicBreak); + expect(tbreak.exists()).toBe(true); + }); + }); + describe('with type="superscript"', () => { it('renders superscript tag', () => { const wrapper = mountWithItem({ diff --git a/tests/unit/components/ContentNode/ThematicBreak.spec.js b/tests/unit/components/ContentNode/ThematicBreak.spec.js new file mode 100644 index 000000000..98f794c93 --- /dev/null +++ b/tests/unit/components/ContentNode/ThematicBreak.spec.js @@ -0,0 +1,20 @@ +/** + * This source file is part of the Swift.org open source project + * + * Copyright (c) 2024 Apple Inc. and the Swift project authors + * Licensed under Apache License v2.0 with Runtime Library Exception + * + * See https://swift.org/LICENSE.txt for license information + * See https://swift.org/CONTRIBUTORS.txt for Swift project authors +*/ +import { shallowMount } from '@vue/test-utils'; +import ThematicBreak from 'docc-render/components/ContentNode/ThematicBreak.vue'; + +describe('ThematicBreak', () => { + it('renders an
element', () => { + const wrapper = shallowMount(ThematicBreak); + const hr = wrapper.find('hr'); + expect(hr.exists()).toBe(true); + expect(hr.classes('thematic-break')).toBe(true); + }); +});