Skip to content

Commit ba2a67e

Browse files
committed
Fix TopicsLinkBlock.spec.js
1 parent 617ae25 commit ba2a67e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,14 +453,15 @@ describe('TopicsLinkBlock', () => {
453453
});
454454

455455
describe('API Changes', () => {
456-
const assertHasAPIChanges = (changeType, isOnLink) => {
456+
const assertHasAPIChanges = async (changeType, isOnLink) => {
457457
store.state.apiChanges = {
458458
'doc://com.example.documentation/foo/bar/baz': {
459459
change: changeType,
460460
},
461461
};
462462

463463
const link = wrapper.findComponent('.link');
464+
await wrapper.vm.$nextTick();
464465
expect(link.classes('changed')).toBe(isOnLink);
465466
expect(link.classes(`changed-${changeType}`)).toBe(isOnLink);
466467
expect(link.find('.visuallyhidden').text()).toEqual(`- ${ChangeNames[changeType]}`);
@@ -470,13 +471,14 @@ describe('TopicsLinkBlock', () => {
470471
expect(linkBlock.classes(`changed-${changeType}`)).toBe(!isOnLink);
471472
};
472473

473-
it('does not render the TopicLinkBlockIcon', () => {
474+
it('does not render the TopicLinkBlockIcon', async () => {
474475
expect(wrapper.findComponent(TopicLinkBlockIcon).exists()).toBe(true);
475476
store.state.apiChanges = {
476477
[propsData.topic.identifier]: {
477478
change: 'modified',
478479
},
479480
};
481+
await wrapper.vm.$nextTick();
480482
expect(wrapper.findComponent(TopicLinkBlockIcon).exists()).toBe(false);
481483
});
482484

0 commit comments

Comments
 (0)