summaryrefslogtreecommitdiff
path: root/spec/frontend/integrations/index/components/integrations_list_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/integrations/index/components/integrations_list_spec.js')
-rw-r--r--spec/frontend/integrations/index/components/integrations_list_spec.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/frontend/integrations/index/components/integrations_list_spec.js b/spec/frontend/integrations/index/components/integrations_list_spec.js
new file mode 100644
index 00000000000..94fd7fc84ee
--- /dev/null
+++ b/spec/frontend/integrations/index/components/integrations_list_spec.js
@@ -0,0 +1,26 @@
+import { shallowMount } from '@vue/test-utils';
+import { extendedWrapper } from 'helpers/vue_test_utils_helper';
+import IntegrationsList from '~/integrations/index/components/integrations_list.vue';
+import { mockActiveIntegrations, mockInactiveIntegrations } from '../mock_data';
+
+describe('IntegrationsList', () => {
+ let wrapper;
+
+ const findActiveIntegrationsTable = () => wrapper.findByTestId('active-integrations-table');
+ const findInactiveIntegrationsTable = () => wrapper.findByTestId('inactive-integrations-table');
+
+ const createComponent = (propsData = {}) => {
+ wrapper = extendedWrapper(shallowMount(IntegrationsList, { propsData }));
+ };
+
+ afterEach(() => {
+ wrapper.destroy();
+ });
+
+ it('provides correct `integrations` prop to the IntegrationsTable instance', () => {
+ createComponent({ integrations: [...mockInactiveIntegrations, ...mockActiveIntegrations] });
+
+ expect(findActiveIntegrationsTable().props('integrations')).toEqual(mockActiveIntegrations);
+ expect(findInactiveIntegrationsTable().props('integrations')).toEqual(mockInactiveIntegrations);
+ });
+});