Skip to content

Commit a88c8ff

Browse files
author
Dobromir Hristov
committed
chore: add samplecode
1 parent ab03e80 commit a88c8ff

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/components/DocumentationTopic/TopicsLinkCardGridItem.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ import TopicTypeIcon from 'docc-render/components/TopicTypeIcon.vue';
3737
import { TopicRole } from '@/constants/roles';
3838

3939
export const ROLE_LINK_TEXT = {
40-
[TopicRole.article]: 'Read Article',
41-
[TopicRole.overview]: 'Start Tutorial',
42-
[TopicRole.collection]: 'View API Collection',
43-
[TopicRole.symbol]: 'View Symbol',
40+
[TopicRole.article]: 'Read article',
41+
[TopicRole.overview]: 'Start tutorial',
42+
[TopicRole.collection]: 'View API collection',
43+
[TopicRole.symbol]: 'View symbol',
44+
[TopicRole.sampleCode]: 'View sample code',
4445
};
4546

4647
export default {

tests/unit/components/DocumentationTopic/TopicsLinkCardGridItem.spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ describe('TopicsLinkCardGridItem', () => {
141141
// symbol
142142
wrapper.setProps({ item: { ...defaultProps.item, role: TopicRole.symbol } });
143143
expect(card.props('linkText')).toBe(ROLE_LINK_TEXT[TopicRole.symbol]);
144+
// sampleCode
145+
wrapper.setProps({ item: { ...defaultProps.item, role: TopicRole.sampleCode } });
146+
expect(card.props('linkText')).toBe(ROLE_LINK_TEXT[TopicRole.sampleCode]);
144147
// other
145148
wrapper.setProps({ item: { ...defaultProps.item, role: TopicRole.link } });
146149
expect(card.props('linkText')).toBe('Learn more');

0 commit comments

Comments
 (0)