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:
Diffstat (limited to 'spec/javascripts/sidebar')
-rw-r--r--spec/javascripts/sidebar/components/time_tracking/time_tracker_spec.js22
-rw-r--r--spec/javascripts/sidebar/confidential_edit_buttons_spec.js12
-rw-r--r--spec/javascripts/sidebar/confidential_edit_form_buttons_spec.js12
-rw-r--r--spec/javascripts/sidebar/confidential_issue_sidebar_spec.js32
-rw-r--r--spec/javascripts/sidebar/lock/edit_form_buttons_spec.js12
-rw-r--r--spec/javascripts/sidebar/lock/edit_form_spec.js12
-rw-r--r--spec/javascripts/sidebar/lock/lock_issue_sidebar_spec.js28
-rw-r--r--spec/javascripts/sidebar/participants_spec.js16
-rw-r--r--spec/javascripts/sidebar/sidebar_assignees_spec.js14
-rw-r--r--spec/javascripts/sidebar/sidebar_mediator_spec.js33
-rw-r--r--spec/javascripts/sidebar/sidebar_move_issue_spec.js24
-rw-r--r--spec/javascripts/sidebar/sidebar_store_spec.js11
-rw-r--r--spec/javascripts/sidebar/sidebar_subscriptions_spec.js2
-rw-r--r--spec/javascripts/sidebar/subscriptions_spec.js14
-rw-r--r--spec/javascripts/sidebar/todo_spec.js10
15 files changed, 122 insertions, 132 deletions
diff --git a/spec/javascripts/sidebar/components/time_tracking/time_tracker_spec.js b/spec/javascripts/sidebar/components/time_tracking/time_tracker_spec.js
index b4aeef182a6..4c3dd713589 100644
--- a/spec/javascripts/sidebar/components/time_tracking/time_tracker_spec.js
+++ b/spec/javascripts/sidebar/components/time_tracking/time_tracker_spec.js
@@ -8,10 +8,12 @@ describe('Issuable Time Tracker', () => {
let initialData;
let vm;
- const initTimeTrackingComponent = ({ timeEstimate,
- timeSpent,
- timeEstimateHumanReadable,
- timeSpentHumanReadable }) => {
+ const initTimeTrackingComponent = ({
+ timeEstimate,
+ timeSpent,
+ timeEstimateHumanReadable,
+ timeSpentHumanReadable,
+ }) => {
setFixtures(`
<div>
<div id="mock-container"></div>
@@ -97,14 +99,18 @@ describe('Issuable Time Tracker', () => {
describe('Remaining meter', () => {
it('should display the remaining meter with the correct width', done => {
Vue.nextTick(() => {
- expect(vm.$el.querySelector('.time-tracking-comparison-pane .progress[value="5"]')).not.toBeNull();
+ expect(
+ vm.$el.querySelector('.time-tracking-comparison-pane .progress[value="5"]'),
+ ).not.toBeNull();
done();
});
});
it('should display the remaining meter with the correct background color when within estimate', done => {
Vue.nextTick(() => {
- expect(vm.$el.querySelector('.time-tracking-comparison-pane .progress[variant="primary"]')).not.toBeNull();
+ expect(
+ vm.$el.querySelector('.time-tracking-comparison-pane .progress[variant="primary"]'),
+ ).not.toBeNull();
done();
});
});
@@ -113,7 +119,9 @@ describe('Issuable Time Tracker', () => {
vm.timeEstimate = 10000; // 2h 46m
vm.timeSpent = 20000000; // 231 days
Vue.nextTick(() => {
- expect(vm.$el.querySelector('.time-tracking-comparison-pane .progress[variant="danger"]')).not.toBeNull();
+ expect(
+ vm.$el.querySelector('.time-tracking-comparison-pane .progress[variant="danger"]'),
+ ).not.toBeNull();
done();
});
});
diff --git a/spec/javascripts/sidebar/confidential_edit_buttons_spec.js b/spec/javascripts/sidebar/confidential_edit_buttons_spec.js
index 482be466aad..32da9f83112 100644
--- a/spec/javascripts/sidebar/confidential_edit_buttons_spec.js
+++ b/spec/javascripts/sidebar/confidential_edit_buttons_spec.js
@@ -7,8 +7,8 @@ describe('Edit Form Buttons', () => {
beforeEach(() => {
const Component = Vue.extend(editFormButtons);
- const toggleForm = () => { };
- const updateConfidentialAttribute = () => { };
+ const toggleForm = () => {};
+ const updateConfidentialAttribute = () => {};
vm1 = new Component({
propsData: {
@@ -28,12 +28,8 @@ describe('Edit Form Buttons', () => {
});
it('renders on or off text based on confidentiality', () => {
- expect(
- vm1.$el.innerHTML.includes('Turn Off'),
- ).toBe(true);
+ expect(vm1.$el.innerHTML.includes('Turn Off')).toBe(true);
- expect(
- vm2.$el.innerHTML.includes('Turn On'),
- ).toBe(true);
+ expect(vm2.$el.innerHTML.includes('Turn On')).toBe(true);
});
});
diff --git a/spec/javascripts/sidebar/confidential_edit_form_buttons_spec.js b/spec/javascripts/sidebar/confidential_edit_form_buttons_spec.js
index 724f5126945..369088cb258 100644
--- a/spec/javascripts/sidebar/confidential_edit_form_buttons_spec.js
+++ b/spec/javascripts/sidebar/confidential_edit_form_buttons_spec.js
@@ -7,8 +7,8 @@ describe('Edit Form Dropdown', () => {
beforeEach(() => {
const Component = Vue.extend(editForm);
- const toggleForm = () => { };
- const updateConfidentialAttribute = () => { };
+ const toggleForm = () => {};
+ const updateConfidentialAttribute = () => {};
vm1 = new Component({
propsData: {
@@ -28,12 +28,8 @@ describe('Edit Form Dropdown', () => {
});
it('renders on the appropriate warning text', () => {
- expect(
- vm1.$el.innerHTML.includes('You are going to turn off the confidentiality.'),
- ).toBe(true);
+ expect(vm1.$el.innerHTML.includes('You are going to turn off the confidentiality.')).toBe(true);
- expect(
- vm2.$el.innerHTML.includes('You are going to turn on the confidentiality.'),
- ).toBe(true);
+ expect(vm2.$el.innerHTML.includes('You are going to turn on the confidentiality.')).toBe(true);
});
});
diff --git a/spec/javascripts/sidebar/confidential_issue_sidebar_spec.js b/spec/javascripts/sidebar/confidential_issue_sidebar_spec.js
index 6110d5d89ac..486a7241e33 100644
--- a/spec/javascripts/sidebar/confidential_issue_sidebar_spec.js
+++ b/spec/javascripts/sidebar/confidential_issue_sidebar_spec.js
@@ -29,20 +29,14 @@ describe('Confidential Issue Sidebar Block', () => {
});
it('shows if confidential and/or editable', () => {
- expect(
- vm1.$el.innerHTML.includes('Edit'),
- ).toBe(true);
+ expect(vm1.$el.innerHTML.includes('Edit')).toBe(true);
- expect(
- vm1.$el.innerHTML.includes('This issue is confidential'),
- ).toBe(true);
+ expect(vm1.$el.innerHTML.includes('This issue is confidential')).toBe(true);
- expect(
- vm2.$el.innerHTML.includes('Not confidential'),
- ).toBe(true);
+ expect(vm2.$el.innerHTML.includes('Not confidential')).toBe(true);
});
- it('displays the edit form when editable', (done) => {
+ it('displays the edit form when editable', done => {
expect(vm1.edit).toBe(false);
vm1.$el.querySelector('.confidential-edit').click();
@@ -50,17 +44,15 @@ describe('Confidential Issue Sidebar Block', () => {
expect(vm1.edit).toBe(true);
setTimeout(() => {
- expect(
- vm1.$el
- .innerHTML
- .includes('You are going to turn off the confidentiality.'),
- ).toBe(true);
+ expect(vm1.$el.innerHTML.includes('You are going to turn off the confidentiality.')).toBe(
+ true,
+ );
done();
});
});
- it('displays the edit form when opened from collapsed state', (done) => {
+ it('displays the edit form when opened from collapsed state', done => {
expect(vm1.edit).toBe(false);
vm1.$el.querySelector('.sidebar-collapsed-icon').click();
@@ -68,11 +60,9 @@ describe('Confidential Issue Sidebar Block', () => {
expect(vm1.edit).toBe(true);
setTimeout(() => {
- expect(
- vm1.$el
- .innerHTML
- .includes('You are going to turn off the confidentiality.'),
- ).toBe(true);
+ expect(vm1.$el.innerHTML.includes('You are going to turn off the confidentiality.')).toBe(
+ true,
+ );
done();
});
diff --git a/spec/javascripts/sidebar/lock/edit_form_buttons_spec.js b/spec/javascripts/sidebar/lock/edit_form_buttons_spec.js
index deeea669de8..330f59f08b2 100644
--- a/spec/javascripts/sidebar/lock/edit_form_buttons_spec.js
+++ b/spec/javascripts/sidebar/lock/edit_form_buttons_spec.js
@@ -8,8 +8,8 @@ describe('EditFormButtons', () => {
beforeEach(() => {
const Component = Vue.extend(editFormButtons);
- const toggleForm = () => { };
- const updateLockedAttribute = () => { };
+ const toggleForm = () => {};
+ const updateLockedAttribute = () => {};
vm1 = mountComponent(Component, {
isLocked: true,
@@ -25,12 +25,8 @@ describe('EditFormButtons', () => {
});
it('renders unlock or lock text based on locked state', () => {
- expect(
- vm1.$el.innerHTML.includes('Unlock'),
- ).toBe(true);
+ expect(vm1.$el.innerHTML.includes('Unlock')).toBe(true);
- expect(
- vm2.$el.innerHTML.includes('Lock'),
- ).toBe(true);
+ expect(vm2.$el.innerHTML.includes('Lock')).toBe(true);
});
});
diff --git a/spec/javascripts/sidebar/lock/edit_form_spec.js b/spec/javascripts/sidebar/lock/edit_form_spec.js
index 7abd6997a18..ec10a999a40 100644
--- a/spec/javascripts/sidebar/lock/edit_form_spec.js
+++ b/spec/javascripts/sidebar/lock/edit_form_spec.js
@@ -7,8 +7,8 @@ describe('EditForm', () => {
beforeEach(() => {
const Component = Vue.extend(editForm);
- const toggleForm = () => { };
- const updateLockedAttribute = () => { };
+ const toggleForm = () => {};
+ const updateLockedAttribute = () => {};
vm1 = new Component({
propsData: {
@@ -30,12 +30,8 @@ describe('EditForm', () => {
});
it('renders on the appropriate warning text', () => {
- expect(
- vm1.$el.innerHTML.includes('Unlock this issue?'),
- ).toBe(true);
+ expect(vm1.$el.innerHTML.includes('Unlock this issue?')).toBe(true);
- expect(
- vm2.$el.innerHTML.includes('Lock this merge request?'),
- ).toBe(true);
+ expect(vm2.$el.innerHTML.includes('Lock this merge request?')).toBe(true);
});
});
diff --git a/spec/javascripts/sidebar/lock/lock_issue_sidebar_spec.js b/spec/javascripts/sidebar/lock/lock_issue_sidebar_spec.js
index 9abc3daf221..ca882032bdf 100644
--- a/spec/javascripts/sidebar/lock/lock_issue_sidebar_spec.js
+++ b/spec/javascripts/sidebar/lock/lock_issue_sidebar_spec.js
@@ -38,20 +38,14 @@ describe('LockIssueSidebar', () => {
});
it('shows if locked and/or editable', () => {
- expect(
- vm1.$el.innerHTML.includes('Edit'),
- ).toBe(true);
+ expect(vm1.$el.innerHTML.includes('Edit')).toBe(true);
- expect(
- vm1.$el.innerHTML.includes('Locked'),
- ).toBe(true);
+ expect(vm1.$el.innerHTML.includes('Locked')).toBe(true);
- expect(
- vm2.$el.innerHTML.includes('Unlocked'),
- ).toBe(true);
+ expect(vm2.$el.innerHTML.includes('Unlocked')).toBe(true);
});
- it('displays the edit form when editable', (done) => {
+ it('displays the edit form when editable', done => {
expect(vm1.isLockDialogOpen).toBe(false);
vm1.$el.querySelector('.lock-edit').click();
@@ -59,17 +53,13 @@ describe('LockIssueSidebar', () => {
expect(vm1.isLockDialogOpen).toBe(true);
vm1.$nextTick(() => {
- expect(
- vm1.$el
- .innerHTML
- .includes('Unlock this issue?'),
- ).toBe(true);
+ expect(vm1.$el.innerHTML.includes('Unlock this issue?')).toBe(true);
done();
});
});
- it('displays the edit form when opened from collapsed state', (done) => {
+ it('displays the edit form when opened from collapsed state', done => {
expect(vm1.isLockDialogOpen).toBe(false);
vm1.$el.querySelector('.sidebar-collapsed-icon').click();
@@ -77,11 +67,7 @@ describe('LockIssueSidebar', () => {
expect(vm1.isLockDialogOpen).toBe(true);
setTimeout(() => {
- expect(
- vm1.$el
- .innerHTML
- .includes('Unlock this issue?'),
- ).toBe(true);
+ expect(vm1.$el.innerHTML.includes('Unlock this issue?')).toBe(true);
done();
});
diff --git a/spec/javascripts/sidebar/participants_spec.js b/spec/javascripts/sidebar/participants_spec.js
index 54b9f30ad93..eb360fd256a 100644
--- a/spec/javascripts/sidebar/participants_spec.js
+++ b/spec/javascripts/sidebar/participants_spec.js
@@ -11,13 +11,9 @@ const PARTICIPANT = {
avatar_url: 'gravatar.com/avatar/xxx',
};
-const PARTICIPANT_LIST = [
- PARTICIPANT,
- { ...PARTICIPANT, id: 2 },
- { ...PARTICIPANT, id: 3 },
-];
+const PARTICIPANT_LIST = [PARTICIPANT, { ...PARTICIPANT, id: 2 }, { ...PARTICIPANT, id: 3 }];
-describe('Participants', function () {
+describe('Participants', function() {
let vm;
let Participants;
@@ -69,7 +65,7 @@ describe('Participants', function () {
expect(vm.$el.querySelector('.js-participants-expanded-loading-icon')).toBeDefined();
});
- it('when only showing visible participants, shows an avatar only for each participant under the limit', (done) => {
+ it('when only showing visible participants, shows an avatar only for each participant under the limit', done => {
const numberOfLessParticipants = 2;
vm = mountComponent(Participants, {
loading: false,
@@ -88,7 +84,7 @@ describe('Participants', function () {
.catch(done.fail);
});
- it('when only showing all participants, each has an avatar', (done) => {
+ it('when only showing all participants, each has an avatar', done => {
const numberOfLessParticipants = 2;
vm = mountComponent(Participants, {
loading: false,
@@ -120,7 +116,7 @@ describe('Participants', function () {
expect(moreParticipantLink).toBeNull();
});
- it('when too many participants, has more participants link to show more', (done) => {
+ it('when too many participants, has more participants link to show more', done => {
vm = mountComponent(Participants, {
loading: false,
participants: PARTICIPANT_LIST,
@@ -138,7 +134,7 @@ describe('Participants', function () {
.catch(done.fail);
});
- it('when too many participants and already showing them, has more participants link to show less', (done) => {
+ it('when too many participants and already showing them, has more participants link to show less', done => {
vm = mountComponent(Participants, {
loading: false,
participants: PARTICIPANT_LIST,
diff --git a/spec/javascripts/sidebar/sidebar_assignees_spec.js b/spec/javascripts/sidebar/sidebar_assignees_spec.js
index 50e86781393..3f0f67d71ca 100644
--- a/spec/javascripts/sidebar/sidebar_assignees_spec.js
+++ b/spec/javascripts/sidebar/sidebar_assignees_spec.js
@@ -24,10 +24,14 @@ describe('sidebar assignees', () => {
const SidebarAssigneeComponent = Vue.extend(SidebarAssignees);
sidebarAssigneesEl = document.querySelector('#js-vue-sidebar-assignees');
- vm = mountComponent(SidebarAssigneeComponent, {
- mediator,
- field: sidebarAssigneesEl.dataset.field,
- }, sidebarAssigneesEl);
+ vm = mountComponent(
+ SidebarAssigneeComponent,
+ {
+ mediator,
+ field: sidebarAssigneesEl.dataset.field,
+ },
+ sidebarAssigneesEl,
+ );
});
afterEach(() => {
@@ -50,7 +54,7 @@ describe('sidebar assignees', () => {
expect(mediator.store.assignees.length).toEqual(1);
});
- it('hides assignees until fetched', (done) => {
+ it('hides assignees until fetched', done => {
const currentAssignee = sidebarAssigneesEl.querySelector('.value');
expect(currentAssignee).toBe(null);
diff --git a/spec/javascripts/sidebar/sidebar_mediator_spec.js b/spec/javascripts/sidebar/sidebar_mediator_spec.js
index da950258a94..2d853970fc4 100644
--- a/spec/javascripts/sidebar/sidebar_mediator_spec.js
+++ b/spec/javascripts/sidebar/sidebar_mediator_spec.js
@@ -25,20 +25,23 @@ describe('Sidebar mediator', function() {
expect(this.mediator.store.assignees[0]).toEqual(Mock.mediator.currentUser);
});
- it('saves assignees', (done) => {
- this.mediator.saveAssignees('issue[assignee_ids]')
- .then((resp) => {
+ it('saves assignees', done => {
+ this.mediator
+ .saveAssignees('issue[assignee_ids]')
+ .then(resp => {
expect(resp.status).toEqual(200);
done();
})
.catch(done.fail);
});
- it('fetches the data', (done) => {
- const mockData = Mock.responseMap.GET['/gitlab-org/gitlab-shell/issues/5.json?serializer=sidebar'];
+ it('fetches the data', done => {
+ const mockData =
+ Mock.responseMap.GET['/gitlab-org/gitlab-shell/issues/5.json?serializer=sidebar'];
spyOn(this.mediator, 'processFetchedData').and.callThrough();
- this.mediator.fetch()
+ this.mediator
+ .fetch()
.then(() => {
expect(this.mediator.processFetchedData).toHaveBeenCalledWith(mockData);
})
@@ -47,7 +50,8 @@ describe('Sidebar mediator', function() {
});
it('processes fetched data', () => {
- const mockData = Mock.responseMap.GET['/gitlab-org/gitlab-shell/issues/5.json?serializer=sidebar'];
+ const mockData =
+ Mock.responseMap.GET['/gitlab-org/gitlab-shell/issues/5.json?serializer=sidebar'];
this.mediator.processFetchedData(mockData);
expect(this.mediator.store.assignees).toEqual(mockData.assignees);
@@ -68,12 +72,13 @@ describe('Sidebar mediator', function() {
expect(this.mediator.store.setMoveToProjectId).toHaveBeenCalledWith(projectId);
});
- it('fetches autocomplete projects', (done) => {
+ it('fetches autocomplete projects', done => {
const searchTerm = 'foo';
spyOn(this.mediator.service, 'getProjectsAutocomplete').and.callThrough();
spyOn(this.mediator.store, 'setAutocompleteProjects').and.callThrough();
- this.mediator.fetchAutocompleteProjects(searchTerm)
+ this.mediator
+ .fetchAutocompleteProjects(searchTerm)
.then(() => {
expect(this.mediator.service.getProjectsAutocomplete).toHaveBeenCalledWith(searchTerm);
expect(this.mediator.store.setAutocompleteProjects).toHaveBeenCalled();
@@ -82,13 +87,14 @@ describe('Sidebar mediator', function() {
.catch(done.fail);
});
- it('moves issue', (done) => {
+ it('moves issue', done => {
const moveToProjectId = 7;
this.mediator.store.setMoveToProjectId(moveToProjectId);
spyOn(this.mediator.service, 'moveIssue').and.callThrough();
const visitUrl = spyOnDependency(SidebarMediator, 'visitUrl');
- this.mediator.moveIssue()
+ this.mediator
+ .moveIssue()
.then(() => {
expect(this.mediator.service.moveIssue).toHaveBeenCalledWith(moveToProjectId);
expect(visitUrl).toHaveBeenCalledWith('/root/some-project/issues/5');
@@ -97,11 +103,12 @@ describe('Sidebar mediator', function() {
.catch(done.fail);
});
- it('toggle subscription', (done) => {
+ it('toggle subscription', done => {
this.mediator.store.setSubscribedState(false);
spyOn(this.mediator.service, 'toggleSubscription').and.callThrough();
- this.mediator.toggleSubscription()
+ this.mediator
+ .toggleSubscription()
.then(() => {
expect(this.mediator.service.toggleSubscription).toHaveBeenCalled();
expect(this.mediator.store.subscribed).toEqual(true);
diff --git a/spec/javascripts/sidebar/sidebar_move_issue_spec.js b/spec/javascripts/sidebar/sidebar_move_issue_spec.js
index 8f35b9ca437..230e0a933a9 100644
--- a/spec/javascripts/sidebar/sidebar_move_issue_spec.js
+++ b/spec/javascripts/sidebar/sidebar_move_issue_spec.js
@@ -7,7 +7,7 @@ import SidebarService from '~/sidebar/services/sidebar_service';
import SidebarMoveIssue from '~/sidebar/lib/sidebar_move_issue';
import Mock from './mock_data';
-describe('SidebarMoveIssue', function () {
+describe('SidebarMoveIssue', function() {
beforeEach(() => {
Vue.http.interceptors.push(Mock.sidebarMockInterceptor);
this.mediator = new SidebarMediator(Mock.mediator);
@@ -72,11 +72,13 @@ describe('SidebarMoveIssue', function () {
expect($.fn.glDropdown).toHaveBeenCalled();
});
- it('escapes html from project name', (done) => {
+ it('escapes html from project name', done => {
this.$toggleButton.dropdown('toggle');
setTimeout(() => {
- expect(this.$content.find('.js-move-issue-dropdown-item')[1].innerHTML.trim()).toEqual('&lt;img src=x onerror=alert(document.domain)&gt; foo / bar');
+ expect(this.$content.find('.js-move-issue-dropdown-item')[1].innerHTML.trim()).toEqual(
+ '&lt;img src=x onerror=alert(document.domain)&gt; foo / bar',
+ );
done();
});
});
@@ -94,7 +96,7 @@ describe('SidebarMoveIssue', function () {
expect(this.$confirmButton.hasClass('is-loading')).toBe(true);
});
- it('should remove loading state from confirm button on failure', (done) => {
+ it('should remove loading state from confirm button on failure', done => {
spyOn(window, 'Flash');
spyOn(this.mediator, 'moveIssue').and.returnValue(Promise.reject());
this.mediator.setMoveToProjectId(7);
@@ -121,7 +123,7 @@ describe('SidebarMoveIssue', function () {
});
});
- it('should set moveToProjectId on dropdown item "No project" click', (done) => {
+ it('should set moveToProjectId on dropdown item "No project" click', done => {
spyOn(this.mediator, 'setMoveToProjectId');
// Open the dropdown
@@ -129,7 +131,10 @@ describe('SidebarMoveIssue', function () {
// Wait for the autocomplete request to finish
setTimeout(() => {
- this.$content.find('.js-move-issue-dropdown-item').eq(0).trigger('click');
+ this.$content
+ .find('.js-move-issue-dropdown-item')
+ .eq(0)
+ .trigger('click');
expect(this.mediator.setMoveToProjectId).toHaveBeenCalledWith(0);
expect(this.$confirmButton.prop('disabled')).toBeTruthy();
@@ -137,7 +142,7 @@ describe('SidebarMoveIssue', function () {
}, 0);
});
- it('should set moveToProjectId on dropdown item click', (done) => {
+ it('should set moveToProjectId on dropdown item click', done => {
spyOn(this.mediator, 'setMoveToProjectId');
// Open the dropdown
@@ -145,7 +150,10 @@ describe('SidebarMoveIssue', function () {
// Wait for the autocomplete request to finish
setTimeout(() => {
- this.$content.find('.js-move-issue-dropdown-item').eq(1).trigger('click');
+ this.$content
+ .find('.js-move-issue-dropdown-item')
+ .eq(1)
+ .trigger('click');
expect(this.mediator.setMoveToProjectId).toHaveBeenCalledWith(20);
expect(this.$confirmButton.attr('disabled')).toBe(undefined);
diff --git a/spec/javascripts/sidebar/sidebar_store_spec.js b/spec/javascripts/sidebar/sidebar_store_spec.js
index 7ba62a59d58..85ff70fffbd 100644
--- a/spec/javascripts/sidebar/sidebar_store_spec.js
+++ b/spec/javascripts/sidebar/sidebar_store_spec.js
@@ -25,20 +25,17 @@ const PARTICIPANT = {
avatar_url: 'gravatar.com/avatar/xxx',
};
-const PARTICIPANT_LIST = [
- PARTICIPANT,
- { ...PARTICIPANT, id: 2 },
- { ...PARTICIPANT, id: 3 },
-];
+const PARTICIPANT_LIST = [PARTICIPANT, { ...PARTICIPANT, id: 2 }, { ...PARTICIPANT, id: 3 }];
-describe('Sidebar store', function () {
+describe('Sidebar store', function() {
beforeEach(() => {
this.store = new SidebarStore({
currentUser: {
id: 1,
name: 'Administrator',
username: 'root',
- avatar_url: 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
+ avatar_url:
+ 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
},
editable: true,
rootPath: '/',
diff --git a/spec/javascripts/sidebar/sidebar_subscriptions_spec.js b/spec/javascripts/sidebar/sidebar_subscriptions_spec.js
index af2fde0a5be..88f64244237 100644
--- a/spec/javascripts/sidebar/sidebar_subscriptions_spec.js
+++ b/spec/javascripts/sidebar/sidebar_subscriptions_spec.js
@@ -6,7 +6,7 @@ import SidebarStore from '~/sidebar/stores/sidebar_store';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import Mock from './mock_data';
-describe('Sidebar Subscriptions', function () {
+describe('Sidebar Subscriptions', function() {
let vm;
let SidebarSubscriptions;
diff --git a/spec/javascripts/sidebar/subscriptions_spec.js b/spec/javascripts/sidebar/subscriptions_spec.js
index 16ff3c043fe..32728e58b06 100644
--- a/spec/javascripts/sidebar/subscriptions_spec.js
+++ b/spec/javascripts/sidebar/subscriptions_spec.js
@@ -3,7 +3,7 @@ import subscriptions from '~/sidebar/components/subscriptions/subscriptions.vue'
import eventHub from '~/sidebar/event_hub';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
-describe('Subscriptions', function () {
+describe('Subscriptions', function() {
let vm;
let Subscriptions;
@@ -22,7 +22,9 @@ describe('Subscriptions', function () {
});
expect(vm.$refs.toggleButton.isLoading).toBe(true);
- expect(vm.$refs.toggleButton.$el.querySelector('.project-feature-toggle')).toHaveClass('is-loading');
+ expect(vm.$refs.toggleButton.$el.querySelector('.project-feature-toggle')).toHaveClass(
+ 'is-loading',
+ );
});
it('is toggled "off" when currently not subscribed', () => {
@@ -30,7 +32,9 @@ describe('Subscriptions', function () {
subscribed: false,
});
- expect(vm.$refs.toggleButton.$el.querySelector('.project-feature-toggle')).not.toHaveClass('is-checked');
+ expect(vm.$refs.toggleButton.$el.querySelector('.project-feature-toggle')).not.toHaveClass(
+ 'is-checked',
+ );
});
it('is toggled "on" when currently subscribed', () => {
@@ -38,7 +42,9 @@ describe('Subscriptions', function () {
subscribed: true,
});
- expect(vm.$refs.toggleButton.$el.querySelector('.project-feature-toggle')).toHaveClass('is-checked');
+ expect(vm.$refs.toggleButton.$el.querySelector('.project-feature-toggle')).toHaveClass(
+ 'is-checked',
+ );
});
it('toggleSubscription method emits `toggleSubscription` event on eventHub and Component', () => {
diff --git a/spec/javascripts/sidebar/todo_spec.js b/spec/javascripts/sidebar/todo_spec.js
index d1d90109405..657e88ecb96 100644
--- a/spec/javascripts/sidebar/todo_spec.js
+++ b/spec/javascripts/sidebar/todo_spec.js
@@ -42,7 +42,9 @@ describe('SidebarTodo', () => {
vm.collapsed = true;
Vue.nextTick()
.then(() => {
- expect(vm.buttonClasses).toBe('btn-blank btn-todo sidebar-collapsed-icon dont-change-state');
+ expect(vm.buttonClasses).toBe(
+ 'btn-blank btn-todo sidebar-collapsed-icon dont-change-state',
+ );
})
.then(done)
.catch(done.fail);
@@ -123,7 +125,7 @@ describe('SidebarTodo', () => {
expect(vm.$el.nodeName).toBe('BUTTON');
const elDataAttrs = vm.$el.dataset;
- Object.keys(elDataAttrs).forEach((attr) => {
+ Object.keys(elDataAttrs).forEach(attr => {
expect(elDataAttrs[attr]).toBe(dataAttributes[attr]);
});
});
@@ -142,7 +144,9 @@ describe('SidebarTodo', () => {
const buttonIconEl = vm.$el.querySelector('svg');
expect(buttonIconEl).not.toBeNull();
- expect(buttonIconEl.querySelector('use').getAttribute('xlink:href')).toContain('todo-done');
+ expect(buttonIconEl.querySelector('use').getAttribute('xlink:href')).toContain(
+ 'todo-done',
+ );
})
.then(done)
.catch(done.fail);