diff options
Diffstat (limited to 'spec/frontend/organizations/index/components/organizations_list_spec.js')
-rw-r--r-- | spec/frontend/organizations/index/components/organizations_list_spec.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/frontend/organizations/index/components/organizations_list_spec.js b/spec/frontend/organizations/index/components/organizations_list_spec.js new file mode 100644 index 00000000000..0b59c212314 --- /dev/null +++ b/spec/frontend/organizations/index/components/organizations_list_spec.js @@ -0,0 +1,28 @@ +import { shallowMount } from '@vue/test-utils'; +import OrganizationsList from '~/organizations/index/components/organizations_list.vue'; +import OrganizationsListItem from '~/organizations/index/components/organizations_list_item.vue'; +import { organizations } from '~/organizations/mock_data'; + +describe('OrganizationsList', () => { + let wrapper; + + const createComponent = () => { + wrapper = shallowMount(OrganizationsList, { + propsData: { + organizations, + }, + }); + }; + + const findAllOrganizationsListItem = () => wrapper.findAllComponents(OrganizationsListItem); + + describe('template', () => { + beforeEach(() => { + createComponent(); + }); + + it('renders a list item for each organization', () => { + expect(findAllOrganizationsListItem()).toHaveLength(organizations.length); + }); + }); +}); |