Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-28 15:09:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-28 15:09:05 +0300
commit5426ca9908085087d465fa52800335f408eb965a (patch)
tree6b442cff02fda9402fc7bb9cf9986e363dd5aaa6 /spec/javascripts
parent67cdfd2683b89bce260600fa8925eefdcdf9e3e5 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/frequent_items/components/frequent_items_list_spec.js90
1 files changed, 0 insertions, 90 deletions
diff --git a/spec/javascripts/frequent_items/components/frequent_items_list_spec.js b/spec/javascripts/frequent_items/components/frequent_items_list_spec.js
deleted file mode 100644
index 3fcd79480cc..00000000000
--- a/spec/javascripts/frequent_items/components/frequent_items_list_spec.js
+++ /dev/null
@@ -1,90 +0,0 @@
-import Vue from 'vue';
-import mountComponent from 'spec/helpers/vue_mount_component_helper';
-import frequentItemsListComponent from '~/frequent_items/components/frequent_items_list.vue';
-import { mockFrequentProjects } from '../mock_data';
-
-const createComponent = (namespace = 'projects') => {
- const Component = Vue.extend(frequentItemsListComponent);
-
- return mountComponent(Component, {
- namespace,
- items: mockFrequentProjects,
- isFetchFailed: false,
- hasSearchQuery: false,
- matcher: 'lab',
- });
-};
-
-describe('FrequentItemsListComponent', () => {
- let vm;
-
- beforeEach(() => {
- vm = createComponent();
- });
-
- afterEach(() => {
- vm.$destroy();
- });
-
- describe('computed', () => {
- describe('isListEmpty', () => {
- it('should return `true` or `false` representing whether if `items` is empty or not with projects', () => {
- vm.items = [];
-
- expect(vm.isListEmpty).toBe(true);
-
- vm.items = mockFrequentProjects;
-
- expect(vm.isListEmpty).toBe(false);
- });
- });
-
- describe('fetched item messages', () => {
- it('should return appropriate empty list message based on value of `localStorageFailed` prop with projects', () => {
- vm.isFetchFailed = true;
-
- expect(vm.listEmptyMessage).toBe('This feature requires browser localStorage support');
-
- vm.isFetchFailed = false;
-
- expect(vm.listEmptyMessage).toBe('Projects you visit often will appear here');
- });
- });
-
- describe('searched item messages', () => {
- it('should return appropriate empty list message based on value of `searchFailed` prop with projects', () => {
- vm.hasSearchQuery = true;
- vm.isFetchFailed = true;
-
- expect(vm.listEmptyMessage).toBe('Something went wrong on our end.');
-
- vm.isFetchFailed = false;
-
- expect(vm.listEmptyMessage).toBe('Sorry, no projects matched your search');
- });
- });
- });
-
- describe('template', () => {
- it('should render component element with list of projects', done => {
- vm.items = mockFrequentProjects;
-
- Vue.nextTick(() => {
- expect(vm.$el.classList.contains('frequent-items-list-container')).toBe(true);
- expect(vm.$el.querySelectorAll('ul.list-unstyled').length).toBe(1);
- expect(vm.$el.querySelectorAll('li.frequent-items-list-item-container').length).toBe(5);
- done();
- });
- });
-
- it('should render component element with empty message', done => {
- vm.items = [];
-
- Vue.nextTick(() => {
- expect(vm.$el.querySelectorAll('li.section-empty').length).toBe(1);
- expect(vm.$el.querySelectorAll('li.frequent-items-list-item-container').length).toBe(0);
- done();
- });
- });
- });
-});