Skip to content

Commit a4e5f3e

Browse files
committed
Fix LinksBlock.spec.js
1 parent 838966a commit a4e5f3e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/unit/components/ContentNode/LinksBlock.spec.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import LinksBlock from '@/components/ContentNode/LinksBlock.vue';
1212
import { shallowMount } from '@vue/test-utils';
1313
import { TopicSectionsStyle } from '@/constants/TopicSectionsStyle';
1414
import TopicsLinkCardGrid from '@/components/DocumentationTopic/TopicsLinkCardGrid.vue';
15-
import TopicsLinkBlock from '@/components/DocumentationTopic/TopicsLinkBlock.vue';
1615

1716
const defaultProps = {
1817
identifiers: ['foo', 'bar', 'baz'],
@@ -29,7 +28,7 @@ const createWrapper = ({ propsData, ...others } = {}) => shallowMount(LinksBlock
2928
...defaultProps,
3029
...propsData,
3130
},
32-
stubs: { TopicsLinkBlock: { props: ['topic'], template: '<div/>' } },
31+
stubs: { TopicsLinkBlock: { props: ['topic'], template: '<div class="topics-link-block"/>' } },
3332
provide: {
3433
store: {
3534
state: { references },
@@ -51,14 +50,13 @@ describe('LinksBlock', () => {
5150
it('renders `TopicsLinkBlock` if `blockStyle` is a `list`', () => {
5251
const wrapper = createWrapper({
5352
propsData: {
54-
items: defaultProps.items,
5553
blockStyle: TopicSectionsStyle.list,
5654
},
5755
});
5856
expect(wrapper.findComponent(TopicsLinkCardGrid).exists()).toBe(false);
5957
expect(wrapper.findComponent('.links-block').exists()).toBe(true);
6058
// they are two, because one does not have a reference object
61-
const linkBlocks = wrapper.findAll(TopicsLinkBlock);
59+
const linkBlocks = wrapper.findAllComponents('.topics-link-block');
6260
expect(linkBlocks).toHaveLength(2);
6361
expect(linkBlocks.at(0).props('topic')).toEqual(references.foo);
6462
expect(linkBlocks.at(1).props('topic')).toEqual(references.bar);

0 commit comments

Comments
 (0)