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 03:09:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-28 03:09:08 +0300
commitf54a50aa826d0eedcf2e56f51462613bc132f826 (patch)
tree7194aca23f9af822ea55966a6f477b3d8d68ee47 /spec/javascripts
parentc77fda905a8619b756163c10a75171dc9cfe7084 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/sidebar/assignee_title_spec.js123
1 files changed, 0 insertions, 123 deletions
diff --git a/spec/javascripts/sidebar/assignee_title_spec.js b/spec/javascripts/sidebar/assignee_title_spec.js
deleted file mode 100644
index 0496e280a21..00000000000
--- a/spec/javascripts/sidebar/assignee_title_spec.js
+++ /dev/null
@@ -1,123 +0,0 @@
-import Vue from 'vue';
-import { mockTracking, triggerEvent } from 'spec/helpers/tracking_helper';
-import AssigneeTitle from '~/sidebar/components/assignees/assignee_title.vue';
-
-describe('AssigneeTitle component', () => {
- let component;
- let AssigneeTitleComponent;
-
- beforeEach(() => {
- AssigneeTitleComponent = Vue.extend(AssigneeTitle);
- });
-
- describe('assignee title', () => {
- it('renders assignee', () => {
- component = new AssigneeTitleComponent({
- propsData: {
- numberOfAssignees: 1,
- editable: false,
- },
- }).$mount();
-
- expect(component.$el.innerText.trim()).toEqual('Assignee');
- });
-
- it('renders 2 assignees', () => {
- component = new AssigneeTitleComponent({
- propsData: {
- numberOfAssignees: 2,
- editable: false,
- },
- }).$mount();
-
- expect(component.$el.innerText.trim()).toEqual('2 Assignees');
- });
- });
-
- describe('gutter toggle', () => {
- it('does not show toggle by default', () => {
- component = new AssigneeTitleComponent({
- propsData: {
- numberOfAssignees: 2,
- editable: false,
- },
- }).$mount();
-
- expect(component.$el.querySelector('.gutter-toggle')).toBeNull();
- });
-
- it('shows toggle when showToggle is true', () => {
- component = new AssigneeTitleComponent({
- propsData: {
- numberOfAssignees: 2,
- editable: false,
- showToggle: true,
- },
- }).$mount();
-
- expect(component.$el.querySelector('.gutter-toggle')).toEqual(jasmine.any(Object));
- });
- });
-
- it('does not render spinner by default', () => {
- component = new AssigneeTitleComponent({
- propsData: {
- numberOfAssignees: 0,
- editable: false,
- },
- }).$mount();
-
- expect(component.$el.querySelector('.fa')).toBeNull();
- });
-
- it('renders spinner when loading', () => {
- component = new AssigneeTitleComponent({
- propsData: {
- loading: true,
- numberOfAssignees: 0,
- editable: false,
- },
- }).$mount();
-
- expect(component.$el.querySelector('.fa')).not.toBeNull();
- });
-
- it('does not render edit link when not editable', () => {
- component = new AssigneeTitleComponent({
- propsData: {
- numberOfAssignees: 0,
- editable: false,
- },
- }).$mount();
-
- expect(component.$el.querySelector('.edit-link')).toBeNull();
- });
-
- it('renders edit link when editable', () => {
- component = new AssigneeTitleComponent({
- propsData: {
- numberOfAssignees: 0,
- editable: true,
- },
- }).$mount();
-
- expect(component.$el.querySelector('.edit-link')).not.toBeNull();
- });
-
- it('tracks the event when edit is clicked', () => {
- component = new AssigneeTitleComponent({
- propsData: {
- numberOfAssignees: 0,
- editable: true,
- },
- }).$mount();
-
- const spy = mockTracking('_category_', component.$el, spyOn);
- triggerEvent('.js-sidebar-dropdown-toggle');
-
- expect(spy).toHaveBeenCalledWith('_category_', 'click_edit_button', {
- label: 'right_sidebar',
- property: 'assignee',
- });
- });
-});