diff options
Diffstat (limited to 'spec/frontend/issuable_suggestions')
-rw-r--r-- | spec/frontend/issuable_suggestions/components/app_spec.js | 10 | ||||
-rw-r--r-- | spec/frontend/issuable_suggestions/components/item_spec.js | 13 |
2 files changed, 11 insertions, 12 deletions
diff --git a/spec/frontend/issuable_suggestions/components/app_spec.js b/spec/frontend/issuable_suggestions/components/app_spec.js index d51c89807be..0cb5b9c90ba 100644 --- a/spec/frontend/issuable_suggestions/components/app_spec.js +++ b/spec/frontend/issuable_suggestions/components/app_spec.js @@ -41,7 +41,7 @@ describe('Issuable suggestions app component', () => { wrapper.setData(data); return wrapper.vm.$nextTick(() => { - expect(wrapper.isEmpty()).toBe(false); + expect(wrapper.findAll('li').length).toBe(data.issues.length); }); }); @@ -89,8 +89,8 @@ describe('Issuable suggestions app component', () => { wrapper .findAll('li') .at(0) - .is('.gl-mb-3'), - ).toBe(true); + .classes(), + ).toContain('gl-mb-3'); }); }); @@ -102,8 +102,8 @@ describe('Issuable suggestions app component', () => { wrapper .findAll('li') .at(1) - .is('.gl-mb-3'), - ).toBe(false); + .classes(), + ).not.toContain('gl-mb-3'); }); }); }); diff --git a/spec/frontend/issuable_suggestions/components/item_spec.js b/spec/frontend/issuable_suggestions/components/item_spec.js index ad37ccd2ca5..9912e77d5fe 100644 --- a/spec/frontend/issuable_suggestions/components/item_spec.js +++ b/spec/frontend/issuable_suggestions/components/item_spec.js @@ -1,7 +1,6 @@ import { shallowMount } from '@vue/test-utils'; -import { GlTooltip, GlLink } from '@gitlab/ui'; +import { GlTooltip, GlLink, GlIcon } from '@gitlab/ui'; import { TEST_HOST } from 'jest/helpers/test_constants'; -import Icon from '~/vue_shared/components/icon.vue'; import UserAvatarImage from '~/vue_shared/components/user_avatar/user_avatar_image.vue'; import Suggestion from '~/issuable_suggestions/components/item.vue'; import mockData from '../mock_data'; @@ -48,7 +47,7 @@ describe('Issuable suggestions suggestion component', () => { it('renders icon', () => { createComponent(); - const icon = vm.find(Icon); + const icon = vm.find(GlIcon); expect(icon.props('name')).toBe('issue-open-m'); }); @@ -71,7 +70,7 @@ describe('Issuable suggestions suggestion component', () => { state: 'closed', }); - const icon = vm.find(Icon); + const icon = vm.find(GlIcon); expect(icon.props('name')).toBe('issue-close'); }); @@ -112,7 +111,7 @@ describe('Issuable suggestions suggestion component', () => { const count = vm.findAll('.suggestion-counts span').at(0); expect(count.text()).toContain('1'); - expect(count.find(Icon).props('name')).toBe('thumb-up'); + expect(count.find(GlIcon).props('name')).toBe('thumb-up'); }); it('renders notes count', () => { @@ -121,7 +120,7 @@ describe('Issuable suggestions suggestion component', () => { const count = vm.findAll('.suggestion-counts span').at(1); expect(count.text()).toContain('2'); - expect(count.find(Icon).props('name')).toBe('comment'); + expect(count.find(GlIcon).props('name')).toBe('comment'); }); }); @@ -131,7 +130,7 @@ describe('Issuable suggestions suggestion component', () => { confidential: true, }); - const icon = vm.find(Icon); + const icon = vm.find(GlIcon); expect(icon.props('name')).toBe('eye-slash'); expect(icon.attributes('title')).toBe('Confidential'); |