Commit a58529a3 authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent 991a2953
...@@ -294,8 +294,8 @@ For the value of: ...@@ -294,8 +294,8 @@ For the value of:
We have used `$CI_ENVIRONMENT_SLUG` here because it is guaranteed to be unique. If We have used `$CI_ENVIRONMENT_SLUG` here because it is guaranteed to be unique. If
you're using a workflow like [GitLab Flow](../topics/gitlab_flow.md), collisions you're using a workflow like [GitLab Flow](../topics/gitlab_flow.md), collisions
are unlikely and you may prefer environment names to be more closely based on the are unlikely and you may prefer environment names to be more closely based on the
branch name. In that case, you could use `$CI_COMMIT_REF_SLUG` in `environment:url` in branch name. In that case, you could use `$CI_COMMIT_REF_NAME` in `environment:url` in
the example above: `https://$CI_COMMIT_REF_SLUG.example.com`, which would give a URL the example above: `https://$CI_COMMIT_REF_NAME.example.com`, which would give a URL
of `https://100-do-the-thing.example.com`. of `https://100-do-the-thing.example.com`.
NOTE: **Note:** NOTE: **Note:**
......
...@@ -35,8 +35,8 @@ apt-get install ruby-dev ...@@ -35,8 +35,8 @@ apt-get install ruby-dev
The Dpl provides support for vast number of services, including: Heroku, Cloud Foundry, AWS/S3, and more. The Dpl provides support for vast number of services, including: Heroku, Cloud Foundry, AWS/S3, and more.
To use it simply define provider and any additional parameters required by the provider. To use it simply define provider and any additional parameters required by the provider.
For example if you want to use it to deploy your application to heroku, you need to specify `heroku` as provider, specify `api-key` and `app`. For example if you want to use it to deploy your application to Heroku, you need to specify `heroku` as provider, specify `api-key` and `app`.
There's more and all possible parameters can be found here: <https://github.com/travis-ci/dpl#heroku>. All possible parameters can be found here: <https://github.com/travis-ci/dpl#heroku-api>.
```yaml ```yaml
staging: staging:
......
...@@ -353,7 +353,7 @@ content. ...@@ -353,7 +353,7 @@ content.
Restriction currently applies to: Restriction currently applies to:
- UI. - UI.
- API access. - [From GitLab 12.3](https://gitlab.com/gitlab-org/gitlab/issues/12874), API access.
- [From GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/issues/32113), Git actions via SSH. - [From GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/issues/32113), Git actions via SSH.
To avoid accidental lock-out, admins and group owners are are able to access To avoid accidental lock-out, admins and group owners are are able to access
......
...@@ -119,7 +119,7 @@ GitLab supports: ...@@ -119,7 +119,7 @@ GitLab supports:
- Creating a new GKE cluster using the GitLab UI. - Creating a new GKE cluster using the GitLab UI.
- Providing credentials to add an [existing Kubernetes cluster](#add-existing-cluster). - Providing credentials to add an [existing Kubernetes cluster](#add-existing-cluster).
Starting from [GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/issues/25925), all the GKE clusters provisioned by GitLab are [VPC-Native](https://cloud.google.com/kubernetes-engine/docs/how-to/alias-ips). Starting from [GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/issues/25925), all the GKE clusters provisioned by GitLab are [VPC-native](https://cloud.google.com/kubernetes-engine/docs/how-to/alias-ips).
NOTE: **Note:** NOTE: **Note:**
The [Google authentication integration](../../../integration/google.md) must The [Google authentication integration](../../../integration/google.md) must
...@@ -281,6 +281,19 @@ To add an existing Kubernetes cluster to your project: ...@@ -281,6 +281,19 @@ To add an existing Kubernetes cluster to your project:
kubectl apply -f gitlab-admin-service-account.yaml kubectl apply -f gitlab-admin-service-account.yaml
``` ```
You will need the `container.clusterRoleBindings.create` permission
to create cluster-level roles. If you do not have this permission,
you can alternatively enable Basic Authentication and then run the
`kubectl apply` command as an admin:
```bash
kubectl apply -f gitlab-admin-service-account.yaml --username=admin --password=<password>
```
NOTE: **Note:**
Basic Authentication can be turned on and the password credentials
can be obtained using the Google Cloud Console.
Output: Output:
```bash ```bash
......
// eslint-disable-next-line import/prefer-default-export
export const keyboardDownEvent = (code, metaKey = false, ctrlKey = false) => {
const e = new CustomEvent('keydown');
e.keyCode = code;
e.metaKey = metaKey;
e.ctrlKey = ctrlKey;
return e;
};
import $ from 'jquery'; import $ from 'jquery';
import Vue from 'vue'; import { mount } from '@vue/test-utils';
import MockAdapter from 'axios-mock-adapter';
import Autosize from 'autosize'; import Autosize from 'autosize';
import axios from '~/lib/utils/axios_utils';
import createStore from '~/notes/stores'; import createStore from '~/notes/stores';
import CommentForm from '~/notes/components/comment_form.vue'; import CommentForm from '~/notes/components/comment_form.vue';
import * as constants from '~/notes/constants'; import * as constants from '~/notes/constants';
import { loggedOutnoteableData, notesDataMock, userDataMock, noteableDataMock } from '../mock_data'; import { refreshUserMergeRequestCounts } from '~/commons/nav/user_merge_requests';
import { trimText } from 'helpers/text_helper';
import { keyboardDownEvent } from '../../issue_show/helpers'; import { keyboardDownEvent } from '../../issue_show/helpers';
import {
loggedOutnoteableData,
notesDataMock,
userDataMock,
noteableDataMock,
} from '../../notes/mock_data';
jest.mock('autosize');
jest.mock('~/commons/nav/user_merge_requests');
jest.mock('~/gl_form');
describe('issue_comment_form component', () => { describe('issue_comment_form component', () => {
let store; let store;
let vm; let wrapper;
const Component = Vue.extend(CommentForm); let axiosMock;
let mountComponent;
const setupStore = (userData, noteableData) => {
store.dispatch('setUserData', userData);
store.dispatch('setNoteableData', noteableData);
store.dispatch('setNotesData', notesDataMock);
};
const mountComponent = (noteableType = 'issue') => {
wrapper = mount(CommentForm, {
propsData: {
noteableType,
},
store,
sync: false,
});
};
beforeEach(() => { beforeEach(() => {
axiosMock = new MockAdapter(axios);
store = createStore(); store = createStore();
mountComponent = (noteableType = 'issue') =>
new Component({
propsData: {
noteableType,
},
store,
}).$mount();
}); });
afterEach(() => { afterEach(() => {
vm.$destroy(); axiosMock.restore();
wrapper.destroy();
jest.clearAllMocks();
}); });
describe('user is logged in', () => { describe('user is logged in', () => {
beforeEach(() => { beforeEach(() => {
store.dispatch('setUserData', userDataMock); setupStore(userDataMock, noteableDataMock);
store.dispatch('setNoteableData', noteableDataMock);
store.dispatch('setNotesData', notesDataMock);
vm = mountComponent(); mountComponent();
}); });
it('should render user avatar with link', () => { it('should render user avatar with link', () => {
expect(vm.$el.querySelector('.timeline-icon .user-avatar-link').getAttribute('href')).toEqual( expect(wrapper.find('.timeline-icon .user-avatar-link').attributes('href')).toEqual(
userDataMock.path, userDataMock.path,
); );
}); });
describe('handleSave', () => { describe('handleSave', () => {
it('should request to save note when note is entered', () => { it('should request to save note when note is entered', () => {
vm.note = 'hello world'; wrapper.vm.note = 'hello world';
spyOn(vm, 'saveNote').and.returnValue(new Promise(() => {})); jest.spyOn(wrapper.vm, 'saveNote').mockReturnValue(new Promise(() => {}));
spyOn(vm, 'resizeTextarea'); jest.spyOn(wrapper.vm, 'resizeTextarea');
spyOn(vm, 'stopPolling'); jest.spyOn(wrapper.vm, 'stopPolling');
vm.handleSave(); wrapper.vm.handleSave();
expect(vm.isSubmitting).toEqual(true); expect(wrapper.vm.isSubmitting).toEqual(true);
expect(vm.note).toEqual(''); expect(wrapper.vm.note).toEqual('');
expect(vm.saveNote).toHaveBeenCalled(); expect(wrapper.vm.saveNote).toHaveBeenCalled();
expect(vm.stopPolling).toHaveBeenCalled(); expect(wrapper.vm.stopPolling).toHaveBeenCalled();
expect(vm.resizeTextarea).toHaveBeenCalled(); expect(wrapper.vm.resizeTextarea).toHaveBeenCalled();
}); });
it('should toggle issue state when no note', () => { it('should toggle issue state when no note', () => {
spyOn(vm, 'toggleIssueState'); jest.spyOn(wrapper.vm, 'toggleIssueState');
vm.handleSave(); wrapper.vm.handleSave();
expect(vm.toggleIssueState).toHaveBeenCalled(); expect(wrapper.vm.toggleIssueState).toHaveBeenCalled();
}); });
it('should disable action button whilst submitting', done => { it('should disable action button whilst submitting', done => {
const saveNotePromise = Promise.resolve(); const saveNotePromise = Promise.resolve();
vm.note = 'hello world'; wrapper.vm.note = 'hello world';
spyOn(vm, 'saveNote').and.returnValue(saveNotePromise); jest.spyOn(wrapper.vm, 'saveNote').mockReturnValue(saveNotePromise);
spyOn(vm, 'stopPolling'); jest.spyOn(wrapper.vm, 'stopPolling');
const actionButton = vm.$el.querySelector('.js-action-button'); const actionButton = wrapper.find('.js-action-button');
vm.handleSave(); wrapper.vm.handleSave();
Vue.nextTick() wrapper.vm
.$nextTick()
.then(() => { .then(() => {
expect(actionButton.disabled).toBeTruthy(); expect(actionButton.vm.disabled).toBeTruthy();
}) })
.then(saveNotePromise) .then(saveNotePromise)
.then(Vue.nextTick) .then(wrapper.vm.$nextTick)
.then(() => { .then(() => {
expect(actionButton.disabled).toBeFalsy(); expect(actionButton.vm.disabled).toBeFalsy();
}) })
.then(done) .then(done)
.catch(done.fail); .catch(done.fail);
...@@ -93,24 +116,26 @@ describe('issue_comment_form component', () => { ...@@ -93,24 +116,26 @@ describe('issue_comment_form component', () => {
describe('textarea', () => { describe('textarea', () => {
it('should render textarea with placeholder', () => { it('should render textarea with placeholder', () => {
expect( expect(wrapper.find('.js-main-target-form textarea').attributes('placeholder')).toEqual(
vm.$el.querySelector('.js-main-target-form textarea').getAttribute('placeholder'), 'Write a comment or drag your files here…',
).toEqual('Write a comment or drag your files here…'); );
}); });
it('should make textarea disabled while requesting', done => { it('should make textarea disabled while requesting', done => {
const $submitButton = $(vm.$el.querySelector('.js-comment-submit-button')); const $submitButton = $(wrapper.find('.js-comment-submit-button').element);
vm.note = 'hello world'; wrapper.vm.note = 'hello world';
spyOn(vm, 'stopPolling'); jest.spyOn(wrapper.vm, 'stopPolling');
spyOn(vm, 'saveNote').and.returnValue(new Promise(() => {})); jest.spyOn(wrapper.vm, 'saveNote').mockReturnValue(new Promise(() => {}));
vm.$nextTick(() => { wrapper.vm.$nextTick(() => {
// Wait for vm.note change triggered. It should enable $submitButton. // Wait for wrapper.vm.note change triggered. It should enable $submitButton.
$submitButton.trigger('click'); $submitButton.trigger('click');
vm.$nextTick(() => { wrapper.vm.$nextTick(() => {
// Wait for vm.isSubmitting triggered. It should disable textarea. // Wait for wrapper.isSubmitting triggered. It should disable textarea.
expect(vm.$el.querySelector('.js-main-target-form textarea').disabled).toBeTruthy(); expect(wrapper.find('.js-main-target-form textarea').attributes('disabled')).toBe(
'disabled',
);
done(); done();
}); });
}); });
...@@ -118,36 +143,39 @@ describe('issue_comment_form component', () => { ...@@ -118,36 +143,39 @@ describe('issue_comment_form component', () => {
it('should support quick actions', () => { it('should support quick actions', () => {
expect( expect(
vm.$el wrapper.find('.js-main-target-form textarea').attributes('data-supports-quick-actions'),
.querySelector('.js-main-target-form textarea') ).toBe('true');
.getAttribute('data-supports-quick-actions'),
).toEqual('true');
}); });
it('should link to markdown docs', () => { it('should link to markdown docs', () => {
const { markdownDocsPath } = notesDataMock; const { markdownDocsPath } = notesDataMock;
expect(vm.$el.querySelector(`a[href="${markdownDocsPath}"]`).textContent.trim()).toEqual( expect(
'Markdown', wrapper
); .find(`a[href="${markdownDocsPath}"]`)
.text()
.trim(),
).toEqual('Markdown');
}); });
it('should link to quick actions docs', () => { it('should link to quick actions docs', () => {
const { quickActionsDocsPath } = notesDataMock; const { quickActionsDocsPath } = notesDataMock;
expect( expect(
vm.$el.querySelector(`a[href="${quickActionsDocsPath}"]`).textContent.trim(), wrapper
.find(`a[href="${quickActionsDocsPath}"]`)
.text()
.trim(),
).toEqual('quick actions'); ).toEqual('quick actions');
}); });
it('should resize textarea after note discarded', done => { it('should resize textarea after note discarded', done => {
spyOn(Autosize, 'update'); jest.spyOn(wrapper.vm, 'discard');
spyOn(vm, 'discard').and.callThrough();
vm.note = 'foo'; wrapper.vm.note = 'foo';
vm.discard(); wrapper.vm.discard();
Vue.nextTick(() => { wrapper.vm.$nextTick(() => {
expect(Autosize.update).toHaveBeenCalled(); expect(Autosize.update).toHaveBeenCalled();
done(); done();
}); });
...@@ -155,97 +183,104 @@ describe('issue_comment_form component', () => { ...@@ -155,97 +183,104 @@ describe('issue_comment_form component', () => {
describe('edit mode', () => { describe('edit mode', () => {
it('should enter edit mode when arrow up is pressed', () => { it('should enter edit mode when arrow up is pressed', () => {
spyOn(vm, 'editCurrentUserLastNote').and.callThrough(); jest.spyOn(wrapper.vm, 'editCurrentUserLastNote');
vm.$el.querySelector('.js-main-target-form textarea').value = 'Foo'; wrapper.find('.js-main-target-form textarea').value = 'Foo';
vm.$el wrapper
.querySelector('.js-main-target-form textarea') .find('.js-main-target-form textarea')
.dispatchEvent(keyboardDownEvent(38, true)); .element.dispatchEvent(keyboardDownEvent(38, true));
expect(vm.editCurrentUserLastNote).toHaveBeenCalled(); expect(wrapper.vm.editCurrentUserLastNote).toHaveBeenCalled();
}); });
it('inits autosave', () => { it('inits autosave', () => {
expect(vm.autosave).toBeDefined(); expect(wrapper.vm.autosave).toBeDefined();
expect(vm.autosave.key).toEqual(`autosave/Note/Issue/${noteableDataMock.id}`); expect(wrapper.vm.autosave.key).toEqual(`autosave/Note/Issue/${noteableDataMock.id}`);
}); });
}); });
describe('event enter', () => { describe('event enter', () => {
it('should save note when cmd+enter is pressed', () => { it('should save note when cmd+enter is pressed', () => {
spyOn(vm, 'handleSave').and.callThrough(); jest.spyOn(wrapper.vm, 'handleSave');
vm.$el.querySelector('.js-main-target-form textarea').value = 'Foo'; wrapper.find('.js-main-target-form textarea').value = 'Foo';
vm.$el wrapper
.querySelector('.js-main-target-form textarea') .find('.js-main-target-form textarea')
.dispatchEvent(keyboardDownEvent(13, true)); .element.dispatchEvent(keyboardDownEvent(13, true));
expect(vm.handleSave).toHaveBeenCalled(); expect(wrapper.vm.handleSave).toHaveBeenCalled();
}); });
it('should save note when ctrl+enter is pressed', () => { it('should save note when ctrl+enter is pressed', () => {
spyOn(vm, 'handleSave').and.callThrough(); jest.spyOn(wrapper.vm, 'handleSave');
vm.$el.querySelector('.js-main-target-form textarea').value = 'Foo'; wrapper.find('.js-main-target-form textarea').value = 'Foo';
vm.$el wrapper
.querySelector('.js-main-target-form textarea') .find('.js-main-target-form textarea')
.dispatchEvent(keyboardDownEvent(13, false, true)); .element.dispatchEvent(keyboardDownEvent(13, false, true));
expect(vm.handleSave).toHaveBeenCalled(); expect(wrapper.vm.handleSave).toHaveBeenCalled();
}); });
}); });
}); });
describe('actions', () => { describe('actions', () => {
it('should be possible to close the issue', () => { it('should be possible to close the issue', () => {
expect(vm.$el.querySelector('.btn-comment-and-close').textContent.trim()).toEqual( expect(
'Close issue', wrapper
); .find('.btn-comment-and-close')
.text()
.trim(),
).toEqual('Close issue');
}); });
it('should render comment button as disabled', () => { it('should render comment button as disabled', () => {
expect(vm.$el.querySelector('.js-comment-submit-button').getAttribute('disabled')).toEqual( expect(wrapper.find('.js-comment-submit-button').attributes('disabled')).toEqual(
'disabled', 'disabled',
); );
}); });
it('should enable comment button if it has note', done => { it('should enable comment button if it has note', done => {
vm.note = 'Foo'; wrapper.vm.note = 'Foo';
Vue.nextTick(() => { wrapper.vm.$nextTick(() => {
expect( expect(wrapper.find('.js-comment-submit-button').attributes('disabled')).toBeFalsy();
vm.$el.querySelector('.js-comment-submit-button').getAttribute('disabled'),
).toEqual(null);
done(); done();
}); });
}); });
it('should update buttons texts when it has note', done => { it('should update buttons texts when it has note', done => {
vm.note = 'Foo'; wrapper.vm.note = 'Foo';
Vue.nextTick(() => { wrapper.vm.$nextTick(() => {
expect(vm.$el.querySelector('.btn-comment-and-close').textContent.trim()).toEqual( expect(
'Comment & close issue', wrapper
); .find('.btn-comment-and-close')
.text()
.trim(),
).toEqual('Comment & close issue');
done(); done();
}); });
}); });
it('updates button text with noteable type', done => { it('updates button text with noteable type', done => {
vm.noteableType = constants.MERGE_REQUEST_NOTEABLE_TYPE; wrapper.setProps({ noteableType: constants.MERGE_REQUEST_NOTEABLE_TYPE });
Vue.nextTick(() => { wrapper.vm.$nextTick(() => {
expect(vm.$el.querySelector('.btn-comment-and-close').textContent.trim()).toEqual( expect(
'Close merge request', wrapper
); .find('.btn-comment-and-close')
.text()
.trim(),
).toEqual('Close merge request');
done(); done();
}); });
}); });
describe('when clicking close/reopen button', () => { describe('when clicking close/reopen button', () => {
it('should disable button and show a loading spinner', done => { it('should disable button and show a loading spinner', done => {
const toggleStateButton = vm.$el.querySelector('.js-action-button'); const toggleStateButton = wrapper.find('.js-action-button');
toggleStateButton.click(); toggleStateButton.trigger('click');
Vue.nextTick(() => { wrapper.vm.$nextTick(() => {
expect(toggleStateButton.disabled).toEqual(true); expect(toggleStateButton.element.disabled).toEqual(true);
expect(toggleStateButton.querySelector('.js-loading-button-icon')).not.toBeNull(); expect(toggleStateButton.find('.js-loading-button-icon').exists()).toBe(true);
done(); done();
}); });
...@@ -254,13 +289,12 @@ describe('issue_comment_form component', () => { ...@@ -254,13 +289,12 @@ describe('issue_comment_form component', () => {
describe('when toggling state', () => { describe('when toggling state', () => {
it('should update MR count', done => { it('should update MR count', done => {
spyOn(vm, 'closeIssue').and.returnValue(Promise.resolve()); jest.spyOn(wrapper.vm, 'closeIssue').mockResolvedValue();
const updateMrCountSpy = spyOnDependency(CommentForm, 'refreshUserMergeRequestCounts'); wrapper.vm.toggleIssueState();
vm.toggleIssueState();
Vue.nextTick(() => { wrapper.vm.$nextTick(() => {
expect(updateMrCountSpy).toHaveBeenCalled(); expect(refreshUserMergeRequestCounts).toHaveBeenCalled();
done(); done();
}); });
...@@ -271,8 +305,8 @@ describe('issue_comment_form component', () => { ...@@ -271,8 +305,8 @@ describe('issue_comment_form component', () => {
describe('issue is confidential', () => { describe('issue is confidential', () => {
it('shows information warning', done => { it('shows information warning', done => {
store.dispatch('setNoteableData', Object.assign(noteableDataMock, { confidential: true })); store.dispatch('setNoteableData', Object.assign(noteableDataMock, { confidential: true }));
Vue.nextTick(() => { wrapper.vm.$nextTick(() => {
expect(vm.$el.querySelector('.confidential-issue-warning')).toBeDefined(); expect(wrapper.find('.confidential-issue-warning')).toBeDefined();
done(); done();
}); });
}); });
...@@ -281,21 +315,17 @@ describe('issue_comment_form component', () => { ...@@ -281,21 +315,17 @@ describe('issue_comment_form component', () => {
describe('user is not logged in', () => { describe('user is not logged in', () => {
beforeEach(() => { beforeEach(() => {
store.dispatch('setUserData', null); setupStore(null, loggedOutnoteableData);
store.dispatch('setNoteableData', loggedOutnoteableData);
store.dispatch('setNotesData', notesDataMock);
vm = mountComponent(); mountComponent();
}); });
it('should render signed out widget', () => { it('should render signed out widget', () => {
expect(vm.$el.textContent.replace(/\s+/g, ' ').trim()).toEqual( expect(trimText(wrapper.text())).toEqual('Please register or sign in to reply');
'Please register or sign in to reply',
);
}); });
it('should not render submission form', () => { it('should not render submission form', () => {
expect(vm.$el.querySelector('textarea')).toEqual(null); expect(wrapper.find('textarea').exists()).toBe(false);
}); });
}); });
}); });
import createStore from '~/notes/stores'; import createStore from '~/notes/stores';
import { shallowMount, mount, createLocalVue } from '@vue/test-utils'; import { shallowMount, mount, createLocalVue } from '@vue/test-utils';
import { discussionMock } from '../../../javascripts/notes/mock_data'; import { discussionMock } from '../../notes/mock_data';
import DiscussionActions from '~/notes/components/discussion_actions.vue'; import DiscussionActions from '~/notes/components/discussion_actions.vue';
import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue'; import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue';
import ResolveDiscussionButton from '~/notes/components/discussion_resolve_button.vue'; import ResolveDiscussionButton from '~/notes/components/discussion_resolve_button.vue';
......
...@@ -8,11 +8,7 @@ import PlaceholderSystemNote from '~/vue_shared/components/notes/placeholder_sys ...@@ -8,11 +8,7 @@ import PlaceholderSystemNote from '~/vue_shared/components/notes/placeholder_sys
import SystemNote from '~/vue_shared/components/notes/system_note.vue'; import SystemNote from '~/vue_shared/components/notes/system_note.vue';
import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue'; import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue';
import createStore from '~/notes/stores'; import createStore from '~/notes/stores';
import { import { noteableDataMock, discussionMock, notesDataMock } from '../../notes/mock_data';
noteableDataMock,
discussionMock,
notesDataMock,
} from '../../../javascripts/notes/mock_data';
const localVue = createLocalVue(); const localVue = createLocalVue();
......
...@@ -9,7 +9,7 @@ import createStore from '~/notes/stores'; ...@@ -9,7 +9,7 @@ import createStore from '~/notes/stores';
import '~/behaviors/markdown/render_gfm'; import '~/behaviors/markdown/render_gfm';
import { setTestTimeout } from 'helpers/timeout'; import { setTestTimeout } from 'helpers/timeout';
// TODO: use generated fixture (https://gitlab.com/gitlab-org/gitlab-foss/issues/62491) // TODO: use generated fixture (https://gitlab.com/gitlab-org/gitlab-foss/issues/62491)
import * as mockData from '../../../javascripts/notes/mock_data'; import * as mockData from '../../notes/mock_data';
setTestTimeout(1000); setTestTimeout(1000);
......
// Copied to ee/spec/frontend/notes/mock_data.js
export const notesDataMock = {
discussionsPath: '/gitlab-org/gitlab-foss/issues/26/discussions.json',
lastFetchedAt: 1501862675,
markdownDocsPath: '/help/user/markdown',
newSessionPath: '/users/sign_in?redirect_to_referer=yes',
notesPath: '/gitlab-org/gitlab-foss/noteable/issue/98/notes',
quickActionsDocsPath: '/help/user/project/quick_actions',
registerPath: '/users/sign_in?redirect_to_referer=yes#register-pane',
prerenderedNotesCount: 1,
closePath: '/twitter/flight/issues/9.json?issue%5Bstate_event%5D=close',
reopenPath: '/twitter/flight/issues/9.json?issue%5Bstate_event%5D=reopen',
canAwardEmoji: true,
};
export const userDataMock = {
avatar_url: 'mock_path',
id: 1,
name: 'Root',
path: '/root',
state: 'active',
username: 'root',
};
export const noteableDataMock = {
assignees: [],
author_id: 1,
branch_name: null,
confidential: false,
create_note_path: '/gitlab-org/gitlab-foss/notes?target_id=98&target_type=issue',
created_at: '2017-02-07T10:11:18.395Z',
current_user: {
can_create_note: true,
can_update: true,
can_award_emoji: true,
},
description: '',
due_date: null,
human_time_estimate: null,
human_total_time_spent: null,
id: 98,
iid: 26,
labels: [],
lock_version: null,
milestone: null,
milestone_id: null,
moved_to_id: null,
preview_note_path: '/gitlab-org/gitlab-foss/preview_markdown?target_id=98&target_type=Issue',
project_id: 2,
state: 'opened',
time_estimate: 0,
title: '14',
total_time_spent: 0,
noteable_note_url: '/group/project/merge_requests/1#note_1',
updated_at: '2017-08-04T09:53:01.226Z',
updated_by_id: 1,
web_url: '/gitlab-org/gitlab-foss/issues/26',
noteableType: 'issue',
};
export const lastFetchedAt = '1501862675';
export const individualNote = {
expanded: true,
id: '0fb4e0e3f9276e55ff32eb4195add694aece4edd',
individual_note: true,
notes: [
{
id: '1390',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: 'test',
path: '/root',
},
created_at: '2017-08-01T17: 09: 33.762Z',
updated_at: '2017-08-01T17: 09: 33.762Z',
system: false,
noteable_id: 98,
noteable_type: 'Issue',
type: null,
human_access: 'Owner',
note: 'sdfdsaf',
note_html: "<p dir='auto'>sdfdsaf</p>",
current_user: {
can_edit: true,
can_award_emoji: true,
},
discussion_id: '0fb4e0e3f9276e55ff32eb4195add694aece4edd',
emoji_awardable: true,
award_emoji: [
{ name: 'baseball', user: { id: 1, name: 'Root', username: 'root' } },
{ name: 'art', user: { id: 1, name: 'Root', username: 'root' } },
],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1390/toggle_award_emoji',
noteable_note_url: '/group/project/merge_requests/1#note_1',
note_url: '/group/project/merge_requests/1#note_1',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1390&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1390',
},
],
reply_id: '0fb4e0e3f9276e55ff32eb4195add694aece4edd',
};
export const note = {
id: '546',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url: 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2017-08-10T15:24:03.087Z',
updated_at: '2017-08-10T15:24:03.087Z',
system: false,
noteable_id: 67,
noteable_type: 'Issue',
noteable_iid: 7,
type: null,
human_access: 'Owner',
note: 'Vel id placeat reprehenderit sit numquam.',
note_html: '<p dir="auto">Vel id placeat reprehenderit sit numquam.</p>',
current_user: {
can_edit: true,
can_award_emoji: true,
},
discussion_id: 'd3842a451b7f3d9a5dfce329515127b2d29a4cd0',
emoji_awardable: true,
award_emoji: [
{
name: 'baseball',
user: {
id: 1,
name: 'Administrator',
username: 'root',
},
},
{
name: 'bath_tone3',
user: {
id: 1,
name: 'Administrator',
username: 'root',
},
},
],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/546/toggle_award_emoji',
note_url: '/group/project/merge_requests/1#note_1',
noteable_note_url: '/group/project/merge_requests/1#note_1',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F7%23note_546&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/546',
};
export const discussionMock = {
id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1',
reply_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1',
expanded: true,
notes: [
{
id: '1395',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
created_at: '2017-08-02T10:51:58.559Z',
updated_at: '2017-08-02T10:51:58.559Z',
system: false,
noteable_id: 98,
noteable_type: 'Issue',
type: 'DiscussionNote',
human_access: 'Owner',
note: 'THIS IS A DICUSSSION!',
note_html: "<p dir='auto'>THIS IS A DICUSSSION!</p>",
current_user: {
can_edit: true,
can_award_emoji: true,
can_resolve: true,
},
discussion_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1',
emoji_awardable: true,
award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1395/toggle_award_emoji',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1395&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1395',
},
{
id: '1396',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
created_at: '2017-08-02T10:56:50.980Z',
updated_at: '2017-08-03T14:19:35.691Z',
system: false,
noteable_id: 98,
noteable_type: 'Issue',
type: 'DiscussionNote',
human_access: 'Owner',
note: 'sadfasdsdgdsf',
note_html: "<p dir='auto'>sadfasdsdgdsf</p>",
last_edited_at: '2017-08-03T14:19:35.691Z',
last_edited_by: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
current_user: {
can_edit: true,
can_award_emoji: true,
can_resolve: true,
},
discussion_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1',
emoji_awardable: true,
award_emoji: [],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1396/toggle_award_emoji',
noteable_note_url: '/group/project/merge_requests/1#note_1',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1396&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1396',
},
{
id: '1437',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
created_at: '2017-08-03T18:11:18.780Z',
updated_at: '2017-08-04T09:52:31.062Z',
system: false,
noteable_id: 98,
noteable_type: 'Issue',
type: 'DiscussionNote',
human_access: 'Owner',
note: 'adsfasf Should disappear',
note_html: "<p dir='auto'>adsfasf Should disappear</p>",
last_edited_at: '2017-08-04T09:52:31.062Z',
last_edited_by: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
current_user: {
can_edit: true,
can_award_emoji: true,
can_resolve: true,
},
discussion_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1',
emoji_awardable: true,
award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1437/toggle_award_emoji',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1437&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1437',
},
],
individual_note: false,
resolvable: true,
active: true,
};
export const loggedOutnoteableData = {
id: '98',
iid: 26,
author_id: 1,
description: '',
lock_version: 1,
milestone_id: null,
state: 'opened',
title: 'asdsa',
updated_by_id: 1,
created_at: '2017-02-07T10:11:18.395Z',
updated_at: '2017-08-08T10:22:51.564Z',
time_estimate: 0,
total_time_spent: 0,
human_time_estimate: null,
human_total_time_spent: null,
milestone: null,
labels: [],
branch_name: null,
confidential: false,
assignees: [
{
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
web_url: 'http://localhost:3000/root',
},
],
due_date: null,
moved_to_id: null,
project_id: 2,
web_url: '/gitlab-org/gitlab-foss/issues/26',
current_user: {
can_create_note: false,
can_update: false,
},
noteable_note_url: '/group/project/merge_requests/1#note_1',
create_note_path: '/gitlab-org/gitlab-foss/notes?target_id=98&target_type=issue',
preview_note_path: '/gitlab-org/gitlab-foss/preview_markdown?target_id=98&target_type=Issue',
};
export const collapseNotesMock = [
{
expanded: true,
id: '0fb4e0e3f9276e55ff32eb4195add694aece4edd',
individual_note: true,
notes: [
{
id: '1390',
attachment: null,
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: 'test',
path: '/root',
},
created_at: '2018-02-26T18:07:41.071Z',
updated_at: '2018-02-26T18:07:41.071Z',
system: true,
system_note_icon_name: 'pencil',
noteable_id: 98,
noteable_type: 'Issue',
type: null,
human_access: 'Owner',
note: 'changed the description',
note_html: '<p dir="auto">changed the description</p>',
current_user: { can_edit: false },
discussion_id: 'b97fb7bda470a65b3e009377a9032edec0a4dd05',
emoji_awardable: false,
path: '/h5bp/html5-boilerplate/notes/1057',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fh5bp%2Fhtml5-boilerplate%2Fissues%2F10%23note_1057&user_id=1',
},
],
},
{
expanded: true,
id: 'ffde43f25984ad7f2b4275135e0e2846875336c0',
individual_note: true,
notes: [
{
id: '1391',
attachment: null,
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: 'test',
path: '/root',
},
created_at: '2018-02-26T18:13:24.071Z',
updated_at: '2018-02-26T18:13:24.071Z',
system: true,
system_note_icon_name: 'pencil',
noteable_id: 99,
noteable_type: 'Issue',
type: null,
human_access: 'Owner',
note: 'changed the description',
note_html: '<p dir="auto">changed the description</p>',
current_user: { can_edit: false },
discussion_id: '3eb958b4d81dec207ec3537a2f3bd8b9f271bb34',
emoji_awardable: false,
path: '/h5bp/html5-boilerplate/notes/1057',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fh5bp%2Fhtml5-boilerplate%2Fissues%2F10%23note_1057&user_id=1',
},
],
},
];
export const INDIVIDUAL_NOTE_RESPONSE_MAP = {
GET: {
'/gitlab-org/gitlab-foss/issues/26/discussions.json': [
{
id: '0fb4e0e3f9276e55ff32eb4195add694aece4edd',
reply_id: '0fb4e0e3f9276e55ff32eb4195add694aece4edd',
expanded: true,
notes: [
{
id: '1390',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
created_at: '2017-08-01T17:09:33.762Z',
updated_at: '2017-08-01T17:09:33.762Z',
system: false,
noteable_id: 98,
noteable_type: 'Issue',
type: null,
human_access: 'Owner',
note: 'sdfdsaf',
note_html: '\u003cp dir="auto"\u003esdfdsaf\u003c/p\u003e',
current_user: {
can_edit: true,
can_award_emoji: true,
},
discussion_id: '0fb4e0e3f9276e55ff32eb4195add694aece4edd',
emoji_awardable: true,
award_emoji: [
{
name: 'baseball',
user: {
id: 1,
name: 'Root',
username: 'root',
},
},
{
name: 'art',
user: {
id: 1,
name: 'Root',
username: 'root',
},
},
],
noteable_note_url: '/group/project/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1390/toggle_award_emoji',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1390\u0026user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1390',
},
],
individual_note: true,
},
{
id: '70d5c92a4039a36c70100c6691c18c27e4b0a790',
reply_id: '70d5c92a4039a36c70100c6691c18c27e4b0a790',
expanded: true,
notes: [
{
id: '1391',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
created_at: '2017-08-02T10:51:38.685Z',
updated_at: '2017-08-02T10:51:38.685Z',
system: false,
noteable_id: 98,
noteable_type: 'Issue',
type: null,
human_access: 'Owner',
note: 'New note!',
note_html: '\u003cp dir="auto"\u003eNew note!\u003c/p\u003e',
current_user: {
can_edit: true,
can_award_emoji: true,
},
discussion_id: '70d5c92a4039a36c70100c6691c18c27e4b0a790',
emoji_awardable: true,
award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1391/toggle_award_emoji',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1391\u0026user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1391',
},
],
individual_note: true,
},
],
'/gitlab-org/gitlab-foss/noteable/issue/98/notes': {
last_fetched_at: 1512900838,
notes: [],
},
},
PUT: {
'/gitlab-org/gitlab-foss/notes/1471': {
commands_changes: null,
valid: true,
id: '1471',
attachment: null,
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
created_at: '2017-08-08T16:53:00.666Z',
updated_at: '2017-12-10T11:03:21.876Z',
system: false,
noteable_id: 124,
noteable_type: 'Issue',
noteable_iid: 29,
type: 'DiscussionNote',
human_access: 'Owner',
note: 'Adding a comment',
note_html: '\u003cp dir="auto"\u003eAdding a comment\u003c/p\u003e',
last_edited_at: '2017-12-10T11:03:21.876Z',
last_edited_by: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
current_user: {
can_edit: true,
can_award_emoji: true,
},
discussion_id: 'a3ed36e29b1957efb3b68c53e2d7a2b24b1df052',
emoji_awardable: true,
award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1471/toggle_award_emoji',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F29%23note_1471\u0026user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1471',
},
},
};
export const DISCUSSION_NOTE_RESPONSE_MAP = {
...INDIVIDUAL_NOTE_RESPONSE_MAP,
GET: {
...INDIVIDUAL_NOTE_RESPONSE_MAP.GET,
'/gitlab-org/gitlab-foss/issues/26/discussions.json': [
{
id: 'a3ed36e29b1957efb3b68c53e2d7a2b24b1df052',
reply_id: 'a3ed36e29b1957efb3b68c53e2d7a2b24b1df052',
expanded: true,
notes: [
{
id: '1471',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
created_at: '2017-08-08T16:53:00.666Z',
updated_at: '2017-08-08T16:53:00.666Z',
system: false,
noteable_id: 124,
noteable_type: 'Issue',
noteable_iid: 29,
type: 'DiscussionNote',
human_access: 'Owner',
note: 'Adding a comment',
note_html: '\u003cp dir="auto"\u003eAdding a comment\u003c/p\u003e',
current_user: {
can_edit: true,
can_award_emoji: true,
},
discussion_id: 'a3ed36e29b1957efb3b68c53e2d7a2b24b1df052',
emoji_awardable: true,
award_emoji: [],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1471/toggle_award_emoji',
noteable_note_url: '/group/project/merge_requests/1#note_1',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F29%23note_1471\u0026user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1471',
},
],
individual_note: false,
},
],
},
};
export function getIndividualNoteResponse(config) {
return [200, INDIVIDUAL_NOTE_RESPONSE_MAP[config.method.toUpperCase()][config.url]];
}
export function getDiscussionNoteResponse(config) {
return [200, DISCUSSION_NOTE_RESPONSE_MAP[config.method.toUpperCase()][config.url]];
}
export const notesWithDescriptionChanges = [
{
id: '39b271c2033e9ed43d8edb393702f65f7a830459',
reply_id: '39b271c2033e9ed43d8edb393702f65f7a830459',
expanded: true,
notes: [
{
id: '901',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:05:36.117Z',
updated_at: '2018-05-29T12:05:36.117Z',
system: false,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
note_html:
'<p dir="auto">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>',
current_user: { can_edit: true, can_award_emoji: true },
resolved: false,
resolved_by: null,
discussion_id: '39b271c2033e9ed43d8edb393702f65f7a830459',
emoji_awardable: true,
award_emoji: [],
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_901&user_id=1',
human_access: 'Owner',
toggle_award_path: '/gitlab-org/gitlab-shell/notes/901/toggle_award_emoji',
path: '/gitlab-org/gitlab-shell/notes/901',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: '4852335d7dc40b9ceb8fde1a2bb9c1b67e4c7795',
reply_id: '4852335d7dc40b9ceb8fde1a2bb9c1b67e4c7795',
expanded: true,
notes: [
{
id: '902',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:05:58.694Z',
updated_at: '2018-05-29T12:05:58.694Z',
system: false,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note:
'Varius vel pharetra vel turpis nunc eget lorem. Ipsum dolor sit amet consectetur adipiscing.',
note_html:
'<p dir="auto">Varius vel pharetra vel turpis nunc eget lorem. Ipsum dolor sit amet consectetur adipiscing.</p>',
current_user: { can_edit: true, can_award_emoji: true },
resolved: false,
resolved_by: null,
discussion_id: '4852335d7dc40b9ceb8fde1a2bb9c1b67e4c7795',
emoji_awardable: true,
award_emoji: [],
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_902&user_id=1',
human_access: 'Owner',
toggle_award_path: '/gitlab-org/gitlab-shell/notes/902/toggle_award_emoji',
path: '/gitlab-org/gitlab-shell/notes/902',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: '7f1feda384083eb31763366e6392399fde6f3f31',
reply_id: '7f1feda384083eb31763366e6392399fde6f3f31',
expanded: true,
notes: [
{
id: '903',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:06:05.772Z',
updated_at: '2018-05-29T12:06:05.772Z',
system: true,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note: 'changed the description',
note_html: '<p dir="auto">changed the description</p>',
current_user: { can_edit: false, can_award_emoji: true },
resolved: false,
resolved_by: null,
system_note_icon_name: 'pencil-square',
discussion_id: '7f1feda384083eb31763366e6392399fde6f3f31',
emoji_awardable: false,
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_903&user_id=1',
human_access: 'Owner',
path: '/gitlab-org/gitlab-shell/notes/903',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: '091865fe3ae20f0045234a3d103e3b15e73405b5',
reply_id: '091865fe3ae20f0045234a3d103e3b15e73405b5',
expanded: true,
notes: [
{
id: '904',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:06:16.112Z',
updated_at: '2018-05-29T12:06:16.112Z',
system: false,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note: 'Ullamcorper eget nulla facilisi etiam',
note_html: '<p dir="auto">Ullamcorper eget nulla facilisi etiam</p>',
current_user: { can_edit: true, can_award_emoji: true },
resolved: false,
resolved_by: null,
discussion_id: '091865fe3ae20f0045234a3d103e3b15e73405b5',
emoji_awardable: true,
award_emoji: [],
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_904&user_id=1',
human_access: 'Owner',
toggle_award_path: '/gitlab-org/gitlab-shell/notes/904/toggle_award_emoji',
path: '/gitlab-org/gitlab-shell/notes/904',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: 'a21cf2e804acc3c60d07e37d75e395f5a9a4d044',
reply_id: 'a21cf2e804acc3c60d07e37d75e395f5a9a4d044',
expanded: true,
notes: [
{
id: '905',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:06:28.851Z',
updated_at: '2018-05-29T12:06:28.851Z',
system: true,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note: 'changed the description',
note_html: '<p dir="auto">changed the description</p>',
current_user: { can_edit: false, can_award_emoji: true },
resolved: false,
resolved_by: null,
system_note_icon_name: 'pencil-square',
discussion_id: 'a21cf2e804acc3c60d07e37d75e395f5a9a4d044',
emoji_awardable: false,
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_905&user_id=1',
human_access: 'Owner',
path: '/gitlab-org/gitlab-shell/notes/905',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: '70411b08cdfc01f24187a06d77daa33464cb2620',
reply_id: '70411b08cdfc01f24187a06d77daa33464cb2620',
expanded: true,
notes: [
{
id: '906',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:20:02.925Z',
updated_at: '2018-05-29T12:20:02.925Z',
system: true,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note: 'changed the description',
note_html: '<p dir="auto">changed the description</p>',
current_user: { can_edit: false, can_award_emoji: true },
resolved: false,
resolved_by: null,
system_note_icon_name: 'pencil-square',
discussion_id: '70411b08cdfc01f24187a06d77daa33464cb2620',
emoji_awardable: false,
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_906&user_id=1',
human_access: 'Owner',
path: '/gitlab-org/gitlab-shell/notes/906',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
];
export const collapsedSystemNotes = [
{
id: '39b271c2033e9ed43d8edb393702f65f7a830459',
reply_id: '39b271c2033e9ed43d8edb393702f65f7a830459',
expanded: true,
notes: [
{
id: '901',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:05:36.117Z',
updated_at: '2018-05-29T12:05:36.117Z',
system: false,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
note_html:
'<p dir="auto">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>',
current_user: { can_edit: true, can_award_emoji: true },
resolved: false,
resolved_by: null,
discussion_id: '39b271c2033e9ed43d8edb393702f65f7a830459',
emoji_awardable: true,
award_emoji: [],
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_901&user_id=1',
human_access: 'Owner',
toggle_award_path: '/gitlab-org/gitlab-shell/notes/901/toggle_award_emoji',
path: '/gitlab-org/gitlab-shell/notes/901',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: '4852335d7dc40b9ceb8fde1a2bb9c1b67e4c7795',
reply_id: '4852335d7dc40b9ceb8fde1a2bb9c1b67e4c7795',
expanded: true,
notes: [
{
id: '902',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:05:58.694Z',
updated_at: '2018-05-29T12:05:58.694Z',
system: false,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note:
'Varius vel pharetra vel turpis nunc eget lorem. Ipsum dolor sit amet consectetur adipiscing.',
note_html:
'<p dir="auto">Varius vel pharetra vel turpis nunc eget lorem. Ipsum dolor sit amet consectetur adipiscing.</p>',
current_user: { can_edit: true, can_award_emoji: true },
resolved: false,
resolved_by: null,
discussion_id: '4852335d7dc40b9ceb8fde1a2bb9c1b67e4c7795',
emoji_awardable: true,
award_emoji: [],
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_902&user_id=1',
human_access: 'Owner',
toggle_award_path: '/gitlab-org/gitlab-shell/notes/902/toggle_award_emoji',
path: '/gitlab-org/gitlab-shell/notes/902',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: '091865fe3ae20f0045234a3d103e3b15e73405b5',
reply_id: '091865fe3ae20f0045234a3d103e3b15e73405b5',
expanded: true,
notes: [
{
id: '904',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:06:16.112Z',
updated_at: '2018-05-29T12:06:16.112Z',
system: false,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note: 'Ullamcorper eget nulla facilisi etiam',
note_html: '<p dir="auto">Ullamcorper eget nulla facilisi etiam</p>',
current_user: { can_edit: true, can_award_emoji: true },
resolved: false,
resolved_by: null,
discussion_id: '091865fe3ae20f0045234a3d103e3b15e73405b5',
emoji_awardable: true,
award_emoji: [],
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_904&user_id=1',
human_access: 'Owner',
toggle_award_path: '/gitlab-org/gitlab-shell/notes/904/toggle_award_emoji',
path: '/gitlab-org/gitlab-shell/notes/904',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: 'a21cf2e804acc3c60d07e37d75e395f5a9a4d044',
reply_id: 'a21cf2e804acc3c60d07e37d75e395f5a9a4d044',
expanded: true,
notes: [
{
id: '905',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:06:28.851Z',
updated_at: '2018-05-29T12:06:28.851Z',
system: true,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note: 'changed the description',
note_html: ' <p dir="auto">changed the description 2 times within 1 minute </p>',
current_user: { can_edit: false, can_award_emoji: true },
resolved: false,
resolved_by: null,
system_note_icon_name: 'pencil-square',
discussion_id: 'a21cf2e804acc3c60d07e37d75e395f5a9a4d044',
emoji_awardable: false,
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_905&user_id=1',
human_access: 'Owner',
path: '/gitlab-org/gitlab-shell/notes/905',
times_updated: 2,
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: '70411b08cdfc01f24187a06d77daa33464cb2620',
reply_id: '70411b08cdfc01f24187a06d77daa33464cb2620',
expanded: true,
notes: [
{
id: '906',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:20:02.925Z',
updated_at: '2018-05-29T12:20:02.925Z',
system: true,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note: 'changed the description',
note_html: '<p dir="auto">changed the description</p>',
current_user: { can_edit: false, can_award_emoji: true },
resolved: false,
resolved_by: null,
system_note_icon_name: 'pencil-square',
discussion_id: '70411b08cdfc01f24187a06d77daa33464cb2620',
emoji_awardable: false,
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_906&user_id=1',
human_access: 'Owner',
path: '/gitlab-org/gitlab-shell/notes/906',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
];
export const discussion1 = {
id: 'abc1',
resolvable: true,
resolved: false,
active: true,
diff_file: {
file_path: 'about.md',
},
position: {
new_line: 50,
old_line: null,
},
notes: [
{
created_at: '2018-07-04T16:25:41.749Z',
},
],
};
export const resolvedDiscussion1 = {
id: 'abc1',
resolvable: true,
resolved: true,
diff_file: {
file_path: 'about.md',
},
position: {
new_line: 50,
old_line: null,
},
notes: [
{
created_at: '2018-07-04T16:25:41.749Z',
},
],
};
export const discussion2 = {
id: 'abc2',
resolvable: true,
resolved: false,
active: true,
diff_file: {
file_path: 'README.md',
},
position: {
new_line: null,
old_line: 20,
},
notes: [
{
created_at: '2018-07-04T12:05:41.749Z',
},
],
};
export const discussion3 = {
id: 'abc3',
resolvable: true,
active: true,
resolved: false,
diff_file: {
file_path: 'README.md',
},
position: {
new_line: 21,
old_line: null,
},
notes: [
{
created_at: '2018-07-05T17:25:41.749Z',
},
],
};
export const unresolvableDiscussion = {
resolvable: false,
};
export const discussionFiltersMock = [
{
title: 'Show all activity',
value: 0,
},
{
title: 'Show comments only',
value: 1,
},
{
title: 'Show system notes only',
value: 2,
},
];
import Vue from 'vue'; import Vue from 'vue';
import issuePlaceholderNote from '~/vue_shared/components/notes/placeholder_note.vue'; import issuePlaceholderNote from '~/vue_shared/components/notes/placeholder_note.vue';
import createStore from '~/notes/stores'; import createStore from '~/notes/stores';
import { userDataMock } from '../../../../javascripts/notes/mock_data'; import { userDataMock } from '../../../notes/mock_data';
describe('issue placeholder system note component', () => { describe('issue placeholder system note component', () => {
let store; let store;
......
// eslint-disable-next-line import/prefer-default-export export * from '../../frontend/issue_show/helpers.js';
export const keyboardDownEvent = (code, metaKey = false, ctrlKey = false) => {
const e = new CustomEvent('keydown');
e.keyCode = code;
e.metaKey = metaKey;
e.ctrlKey = ctrlKey;
return e;
};
// Copied to ee/spec/frontend/notes/mock_data.js export * from '../../frontend/notes/mock_data.js';
export const notesDataMock = {
discussionsPath: '/gitlab-org/gitlab-foss/issues/26/discussions.json',
lastFetchedAt: 1501862675,
markdownDocsPath: '/help/user/markdown',
newSessionPath: '/users/sign_in?redirect_to_referer=yes',
notesPath: '/gitlab-org/gitlab-foss/noteable/issue/98/notes',
quickActionsDocsPath: '/help/user/project/quick_actions',
registerPath: '/users/sign_in?redirect_to_referer=yes#register-pane',
prerenderedNotesCount: 1,
closePath: '/twitter/flight/issues/9.json?issue%5Bstate_event%5D=close',
reopenPath: '/twitter/flight/issues/9.json?issue%5Bstate_event%5D=reopen',
canAwardEmoji: true,
};
export const userDataMock = {
avatar_url: 'mock_path',
id: 1,
name: 'Root',
path: '/root',
state: 'active',
username: 'root',
};
export const noteableDataMock = {
assignees: [],
author_id: 1,
branch_name: null,
confidential: false,
create_note_path: '/gitlab-org/gitlab-foss/notes?target_id=98&target_type=issue',
created_at: '2017-02-07T10:11:18.395Z',
current_user: {
can_create_note: true,
can_update: true,
can_award_emoji: true,
},
description: '',
due_date: null,
human_time_estimate: null,
human_total_time_spent: null,
id: 98,
iid: 26,
labels: [],
lock_version: null,
milestone: null,
milestone_id: null,
moved_to_id: null,
preview_note_path: '/gitlab-org/gitlab-foss/preview_markdown?target_id=98&target_type=Issue',
project_id: 2,
state: 'opened',
time_estimate: 0,
title: '14',
total_time_spent: 0,
noteable_note_url: '/group/project/merge_requests/1#note_1',
updated_at: '2017-08-04T09:53:01.226Z',
updated_by_id: 1,
web_url: '/gitlab-org/gitlab-foss/issues/26',
noteableType: 'issue',
};
export const lastFetchedAt = '1501862675';
export const individualNote = {
expanded: true,
id: '0fb4e0e3f9276e55ff32eb4195add694aece4edd',
individual_note: true,
notes: [
{
id: '1390',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: 'test',
path: '/root',
},
created_at: '2017-08-01T17: 09: 33.762Z',
updated_at: '2017-08-01T17: 09: 33.762Z',
system: false,
noteable_id: 98,
noteable_type: 'Issue',
type: null,
human_access: 'Owner',
note: 'sdfdsaf',
note_html: "<p dir='auto'>sdfdsaf</p>",
current_user: {
can_edit: true,
can_award_emoji: true,
},
discussion_id: '0fb4e0e3f9276e55ff32eb4195add694aece4edd',
emoji_awardable: true,
award_emoji: [
{ name: 'baseball', user: { id: 1, name: 'Root', username: 'root' } },
{ name: 'art', user: { id: 1, name: 'Root', username: 'root' } },
],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1390/toggle_award_emoji',
noteable_note_url: '/group/project/merge_requests/1#note_1',
note_url: '/group/project/merge_requests/1#note_1',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1390&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1390',
},
],
reply_id: '0fb4e0e3f9276e55ff32eb4195add694aece4edd',
};
export const note = {
id: '546',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url: 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2017-08-10T15:24:03.087Z',
updated_at: '2017-08-10T15:24:03.087Z',
system: false,
noteable_id: 67,
noteable_type: 'Issue',
noteable_iid: 7,
type: null,
human_access: 'Owner',
note: 'Vel id placeat reprehenderit sit numquam.',
note_html: '<p dir="auto">Vel id placeat reprehenderit sit numquam.</p>',
current_user: {
can_edit: true,
can_award_emoji: true,
},
discussion_id: 'd3842a451b7f3d9a5dfce329515127b2d29a4cd0',
emoji_awardable: true,
award_emoji: [
{
name: 'baseball',
user: {
id: 1,
name: 'Administrator',
username: 'root',
},
},
{
name: 'bath_tone3',
user: {
id: 1,
name: 'Administrator',
username: 'root',
},
},
],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/546/toggle_award_emoji',
note_url: '/group/project/merge_requests/1#note_1',
noteable_note_url: '/group/project/merge_requests/1#note_1',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F7%23note_546&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/546',
};
export const discussionMock = {
id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1',
reply_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1',
expanded: true,
notes: [
{
id: '1395',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
created_at: '2017-08-02T10:51:58.559Z',
updated_at: '2017-08-02T10:51:58.559Z',
system: false,
noteable_id: 98,
noteable_type: 'Issue',
type: 'DiscussionNote',
human_access: 'Owner',
note: 'THIS IS A DICUSSSION!',
note_html: "<p dir='auto'>THIS IS A DICUSSSION!</p>",
current_user: {
can_edit: true,
can_award_emoji: true,
can_resolve: true,
},
discussion_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1',
emoji_awardable: true,
award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1395/toggle_award_emoji',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1395&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1395',
},
{
id: '1396',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
created_at: '2017-08-02T10:56:50.980Z',
updated_at: '2017-08-03T14:19:35.691Z',
system: false,
noteable_id: 98,
noteable_type: 'Issue',
type: 'DiscussionNote',
human_access: 'Owner',
note: 'sadfasdsdgdsf',
note_html: "<p dir='auto'>sadfasdsdgdsf</p>",
last_edited_at: '2017-08-03T14:19:35.691Z',
last_edited_by: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
current_user: {
can_edit: true,
can_award_emoji: true,
can_resolve: true,
},
discussion_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1',
emoji_awardable: true,
award_emoji: [],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1396/toggle_award_emoji',
noteable_note_url: '/group/project/merge_requests/1#note_1',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1396&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1396',
},
{
id: '1437',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
created_at: '2017-08-03T18:11:18.780Z',
updated_at: '2017-08-04T09:52:31.062Z',
system: false,
noteable_id: 98,
noteable_type: 'Issue',
type: 'DiscussionNote',
human_access: 'Owner',
note: 'adsfasf Should disappear',
note_html: "<p dir='auto'>adsfasf Should disappear</p>",
last_edited_at: '2017-08-04T09:52:31.062Z',
last_edited_by: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
current_user: {
can_edit: true,
can_award_emoji: true,
can_resolve: true,
},
discussion_id: '9e3bd2f71a01de45fd166e6719eb380ad9f270b1',
emoji_awardable: true,
award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1437/toggle_award_emoji',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1437&user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1437',
},
],
individual_note: false,
resolvable: true,
active: true,
};
export const loggedOutnoteableData = {
id: '98',
iid: 26,
author_id: 1,
description: '',
lock_version: 1,
milestone_id: null,
state: 'opened',
title: 'asdsa',
updated_by_id: 1,
created_at: '2017-02-07T10:11:18.395Z',
updated_at: '2017-08-08T10:22:51.564Z',
time_estimate: 0,
total_time_spent: 0,
human_time_estimate: null,
human_total_time_spent: null,
milestone: null,
labels: [],
branch_name: null,
confidential: false,
assignees: [
{
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
web_url: 'http://localhost:3000/root',
},
],
due_date: null,
moved_to_id: null,
project_id: 2,
web_url: '/gitlab-org/gitlab-foss/issues/26',
current_user: {
can_create_note: false,
can_update: false,
},
noteable_note_url: '/group/project/merge_requests/1#note_1',
create_note_path: '/gitlab-org/gitlab-foss/notes?target_id=98&target_type=issue',
preview_note_path: '/gitlab-org/gitlab-foss/preview_markdown?target_id=98&target_type=Issue',
};
export const collapseNotesMock = [
{
expanded: true,
id: '0fb4e0e3f9276e55ff32eb4195add694aece4edd',
individual_note: true,
notes: [
{
id: '1390',
attachment: null,
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: 'test',
path: '/root',
},
created_at: '2018-02-26T18:07:41.071Z',
updated_at: '2018-02-26T18:07:41.071Z',
system: true,
system_note_icon_name: 'pencil',
noteable_id: 98,
noteable_type: 'Issue',
type: null,
human_access: 'Owner',
note: 'changed the description',
note_html: '<p dir="auto">changed the description</p>',
current_user: { can_edit: false },
discussion_id: 'b97fb7bda470a65b3e009377a9032edec0a4dd05',
emoji_awardable: false,
path: '/h5bp/html5-boilerplate/notes/1057',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fh5bp%2Fhtml5-boilerplate%2Fissues%2F10%23note_1057&user_id=1',
},
],
},
{
expanded: true,
id: 'ffde43f25984ad7f2b4275135e0e2846875336c0',
individual_note: true,
notes: [
{
id: '1391',
attachment: null,
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: 'test',
path: '/root',
},
created_at: '2018-02-26T18:13:24.071Z',
updated_at: '2018-02-26T18:13:24.071Z',
system: true,
system_note_icon_name: 'pencil',
noteable_id: 99,
noteable_type: 'Issue',
type: null,
human_access: 'Owner',
note: 'changed the description',
note_html: '<p dir="auto">changed the description</p>',
current_user: { can_edit: false },
discussion_id: '3eb958b4d81dec207ec3537a2f3bd8b9f271bb34',
emoji_awardable: false,
path: '/h5bp/html5-boilerplate/notes/1057',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fh5bp%2Fhtml5-boilerplate%2Fissues%2F10%23note_1057&user_id=1',
},
],
},
];
export const INDIVIDUAL_NOTE_RESPONSE_MAP = {
GET: {
'/gitlab-org/gitlab-foss/issues/26/discussions.json': [
{
id: '0fb4e0e3f9276e55ff32eb4195add694aece4edd',
reply_id: '0fb4e0e3f9276e55ff32eb4195add694aece4edd',
expanded: true,
notes: [
{
id: '1390',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
created_at: '2017-08-01T17:09:33.762Z',
updated_at: '2017-08-01T17:09:33.762Z',
system: false,
noteable_id: 98,
noteable_type: 'Issue',
type: null,
human_access: 'Owner',
note: 'sdfdsaf',
note_html: '\u003cp dir="auto"\u003esdfdsaf\u003c/p\u003e',
current_user: {
can_edit: true,
can_award_emoji: true,
},
discussion_id: '0fb4e0e3f9276e55ff32eb4195add694aece4edd',
emoji_awardable: true,
award_emoji: [
{
name: 'baseball',
user: {
id: 1,
name: 'Root',
username: 'root',
},
},
{
name: 'art',
user: {
id: 1,
name: 'Root',
username: 'root',
},
},
],
noteable_note_url: '/group/project/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1390/toggle_award_emoji',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1390\u0026user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1390',
},
],
individual_note: true,
},
{
id: '70d5c92a4039a36c70100c6691c18c27e4b0a790',
reply_id: '70d5c92a4039a36c70100c6691c18c27e4b0a790',
expanded: true,
notes: [
{
id: '1391',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
created_at: '2017-08-02T10:51:38.685Z',
updated_at: '2017-08-02T10:51:38.685Z',
system: false,
noteable_id: 98,
noteable_type: 'Issue',
type: null,
human_access: 'Owner',
note: 'New note!',
note_html: '\u003cp dir="auto"\u003eNew note!\u003c/p\u003e',
current_user: {
can_edit: true,
can_award_emoji: true,
},
discussion_id: '70d5c92a4039a36c70100c6691c18c27e4b0a790',
emoji_awardable: true,
award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1391/toggle_award_emoji',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F26%23note_1391\u0026user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1391',
},
],
individual_note: true,
},
],
'/gitlab-org/gitlab-foss/noteable/issue/98/notes': {
last_fetched_at: 1512900838,
notes: [],
},
},
PUT: {
'/gitlab-org/gitlab-foss/notes/1471': {
commands_changes: null,
valid: true,
id: '1471',
attachment: null,
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
created_at: '2017-08-08T16:53:00.666Z',
updated_at: '2017-12-10T11:03:21.876Z',
system: false,
noteable_id: 124,
noteable_type: 'Issue',
noteable_iid: 29,
type: 'DiscussionNote',
human_access: 'Owner',
note: 'Adding a comment',
note_html: '\u003cp dir="auto"\u003eAdding a comment\u003c/p\u003e',
last_edited_at: '2017-12-10T11:03:21.876Z',
last_edited_by: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
current_user: {
can_edit: true,
can_award_emoji: true,
},
discussion_id: 'a3ed36e29b1957efb3b68c53e2d7a2b24b1df052',
emoji_awardable: true,
award_emoji: [],
noteable_note_url: '/group/project/merge_requests/1#note_1',
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1471/toggle_award_emoji',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F29%23note_1471\u0026user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1471',
},
},
};
export const DISCUSSION_NOTE_RESPONSE_MAP = {
...INDIVIDUAL_NOTE_RESPONSE_MAP,
GET: {
...INDIVIDUAL_NOTE_RESPONSE_MAP.GET,
'/gitlab-org/gitlab-foss/issues/26/discussions.json': [
{
id: 'a3ed36e29b1957efb3b68c53e2d7a2b24b1df052',
reply_id: 'a3ed36e29b1957efb3b68c53e2d7a2b24b1df052',
expanded: true,
notes: [
{
id: '1471',
attachment: {
url: null,
filename: null,
image: false,
},
author: {
id: 1,
name: 'Root',
username: 'root',
state: 'active',
avatar_url: null,
path: '/root',
},
created_at: '2017-08-08T16:53:00.666Z',
updated_at: '2017-08-08T16:53:00.666Z',
system: false,
noteable_id: 124,
noteable_type: 'Issue',
noteable_iid: 29,
type: 'DiscussionNote',
human_access: 'Owner',
note: 'Adding a comment',
note_html: '\u003cp dir="auto"\u003eAdding a comment\u003c/p\u003e',
current_user: {
can_edit: true,
can_award_emoji: true,
},
discussion_id: 'a3ed36e29b1957efb3b68c53e2d7a2b24b1df052',
emoji_awardable: true,
award_emoji: [],
toggle_award_path: '/gitlab-org/gitlab-foss/notes/1471/toggle_award_emoji',
noteable_note_url: '/group/project/merge_requests/1#note_1',
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-ce%2Fissues%2F29%23note_1471\u0026user_id=1',
path: '/gitlab-org/gitlab-foss/notes/1471',
},
],
individual_note: false,
},
],
},
};
export function getIndividualNoteResponse(config) {
return [200, INDIVIDUAL_NOTE_RESPONSE_MAP[config.method.toUpperCase()][config.url]];
}
export function getDiscussionNoteResponse(config) {
return [200, DISCUSSION_NOTE_RESPONSE_MAP[config.method.toUpperCase()][config.url]];
}
export const notesWithDescriptionChanges = [
{
id: '39b271c2033e9ed43d8edb393702f65f7a830459',
reply_id: '39b271c2033e9ed43d8edb393702f65f7a830459',
expanded: true,
notes: [
{
id: '901',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:05:36.117Z',
updated_at: '2018-05-29T12:05:36.117Z',
system: false,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
note_html:
'<p dir="auto">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>',
current_user: { can_edit: true, can_award_emoji: true },
resolved: false,
resolved_by: null,
discussion_id: '39b271c2033e9ed43d8edb393702f65f7a830459',
emoji_awardable: true,
award_emoji: [],
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_901&user_id=1',
human_access: 'Owner',
toggle_award_path: '/gitlab-org/gitlab-shell/notes/901/toggle_award_emoji',
path: '/gitlab-org/gitlab-shell/notes/901',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: '4852335d7dc40b9ceb8fde1a2bb9c1b67e4c7795',
reply_id: '4852335d7dc40b9ceb8fde1a2bb9c1b67e4c7795',
expanded: true,
notes: [
{
id: '902',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:05:58.694Z',
updated_at: '2018-05-29T12:05:58.694Z',
system: false,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note:
'Varius vel pharetra vel turpis nunc eget lorem. Ipsum dolor sit amet consectetur adipiscing.',
note_html:
'<p dir="auto">Varius vel pharetra vel turpis nunc eget lorem. Ipsum dolor sit amet consectetur adipiscing.</p>',
current_user: { can_edit: true, can_award_emoji: true },
resolved: false,
resolved_by: null,
discussion_id: '4852335d7dc40b9ceb8fde1a2bb9c1b67e4c7795',
emoji_awardable: true,
award_emoji: [],
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_902&user_id=1',
human_access: 'Owner',
toggle_award_path: '/gitlab-org/gitlab-shell/notes/902/toggle_award_emoji',
path: '/gitlab-org/gitlab-shell/notes/902',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: '7f1feda384083eb31763366e6392399fde6f3f31',
reply_id: '7f1feda384083eb31763366e6392399fde6f3f31',
expanded: true,
notes: [
{
id: '903',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:06:05.772Z',
updated_at: '2018-05-29T12:06:05.772Z',
system: true,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note: 'changed the description',
note_html: '<p dir="auto">changed the description</p>',
current_user: { can_edit: false, can_award_emoji: true },
resolved: false,
resolved_by: null,
system_note_icon_name: 'pencil-square',
discussion_id: '7f1feda384083eb31763366e6392399fde6f3f31',
emoji_awardable: false,
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_903&user_id=1',
human_access: 'Owner',
path: '/gitlab-org/gitlab-shell/notes/903',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: '091865fe3ae20f0045234a3d103e3b15e73405b5',
reply_id: '091865fe3ae20f0045234a3d103e3b15e73405b5',
expanded: true,
notes: [
{
id: '904',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:06:16.112Z',
updated_at: '2018-05-29T12:06:16.112Z',
system: false,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note: 'Ullamcorper eget nulla facilisi etiam',
note_html: '<p dir="auto">Ullamcorper eget nulla facilisi etiam</p>',
current_user: { can_edit: true, can_award_emoji: true },
resolved: false,
resolved_by: null,
discussion_id: '091865fe3ae20f0045234a3d103e3b15e73405b5',
emoji_awardable: true,
award_emoji: [],
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_904&user_id=1',
human_access: 'Owner',
toggle_award_path: '/gitlab-org/gitlab-shell/notes/904/toggle_award_emoji',
path: '/gitlab-org/gitlab-shell/notes/904',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: 'a21cf2e804acc3c60d07e37d75e395f5a9a4d044',
reply_id: 'a21cf2e804acc3c60d07e37d75e395f5a9a4d044',
expanded: true,
notes: [
{
id: '905',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:06:28.851Z',
updated_at: '2018-05-29T12:06:28.851Z',
system: true,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note: 'changed the description',
note_html: '<p dir="auto">changed the description</p>',
current_user: { can_edit: false, can_award_emoji: true },
resolved: false,
resolved_by: null,
system_note_icon_name: 'pencil-square',
discussion_id: 'a21cf2e804acc3c60d07e37d75e395f5a9a4d044',
emoji_awardable: false,
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_905&user_id=1',
human_access: 'Owner',
path: '/gitlab-org/gitlab-shell/notes/905',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: '70411b08cdfc01f24187a06d77daa33464cb2620',
reply_id: '70411b08cdfc01f24187a06d77daa33464cb2620',
expanded: true,
notes: [
{
id: '906',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:20:02.925Z',
updated_at: '2018-05-29T12:20:02.925Z',
system: true,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note: 'changed the description',
note_html: '<p dir="auto">changed the description</p>',
current_user: { can_edit: false, can_award_emoji: true },
resolved: false,
resolved_by: null,
system_note_icon_name: 'pencil-square',
discussion_id: '70411b08cdfc01f24187a06d77daa33464cb2620',
emoji_awardable: false,
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_906&user_id=1',
human_access: 'Owner',
path: '/gitlab-org/gitlab-shell/notes/906',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
];
export const collapsedSystemNotes = [
{
id: '39b271c2033e9ed43d8edb393702f65f7a830459',
reply_id: '39b271c2033e9ed43d8edb393702f65f7a830459',
expanded: true,
notes: [
{
id: '901',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:05:36.117Z',
updated_at: '2018-05-29T12:05:36.117Z',
system: false,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
note_html:
'<p dir="auto">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>',
current_user: { can_edit: true, can_award_emoji: true },
resolved: false,
resolved_by: null,
discussion_id: '39b271c2033e9ed43d8edb393702f65f7a830459',
emoji_awardable: true,
award_emoji: [],
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_901&user_id=1',
human_access: 'Owner',
toggle_award_path: '/gitlab-org/gitlab-shell/notes/901/toggle_award_emoji',
path: '/gitlab-org/gitlab-shell/notes/901',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: '4852335d7dc40b9ceb8fde1a2bb9c1b67e4c7795',
reply_id: '4852335d7dc40b9ceb8fde1a2bb9c1b67e4c7795',
expanded: true,
notes: [
{
id: '902',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:05:58.694Z',
updated_at: '2018-05-29T12:05:58.694Z',
system: false,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note:
'Varius vel pharetra vel turpis nunc eget lorem. Ipsum dolor sit amet consectetur adipiscing.',
note_html:
'<p dir="auto">Varius vel pharetra vel turpis nunc eget lorem. Ipsum dolor sit amet consectetur adipiscing.</p>',
current_user: { can_edit: true, can_award_emoji: true },
resolved: false,
resolved_by: null,
discussion_id: '4852335d7dc40b9ceb8fde1a2bb9c1b67e4c7795',
emoji_awardable: true,
award_emoji: [],
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_902&user_id=1',
human_access: 'Owner',
toggle_award_path: '/gitlab-org/gitlab-shell/notes/902/toggle_award_emoji',
path: '/gitlab-org/gitlab-shell/notes/902',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: '091865fe3ae20f0045234a3d103e3b15e73405b5',
reply_id: '091865fe3ae20f0045234a3d103e3b15e73405b5',
expanded: true,
notes: [
{
id: '904',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:06:16.112Z',
updated_at: '2018-05-29T12:06:16.112Z',
system: false,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note: 'Ullamcorper eget nulla facilisi etiam',
note_html: '<p dir="auto">Ullamcorper eget nulla facilisi etiam</p>',
current_user: { can_edit: true, can_award_emoji: true },
resolved: false,
resolved_by: null,
discussion_id: '091865fe3ae20f0045234a3d103e3b15e73405b5',
emoji_awardable: true,
award_emoji: [],
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_904&user_id=1',
human_access: 'Owner',
toggle_award_path: '/gitlab-org/gitlab-shell/notes/904/toggle_award_emoji',
path: '/gitlab-org/gitlab-shell/notes/904',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: 'a21cf2e804acc3c60d07e37d75e395f5a9a4d044',
reply_id: 'a21cf2e804acc3c60d07e37d75e395f5a9a4d044',
expanded: true,
notes: [
{
id: '905',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:06:28.851Z',
updated_at: '2018-05-29T12:06:28.851Z',
system: true,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note: 'changed the description',
note_html: ' <p dir="auto">changed the description 2 times within 1 minute </p>',
current_user: { can_edit: false, can_award_emoji: true },
resolved: false,
resolved_by: null,
system_note_icon_name: 'pencil-square',
discussion_id: 'a21cf2e804acc3c60d07e37d75e395f5a9a4d044',
emoji_awardable: false,
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_905&user_id=1',
human_access: 'Owner',
path: '/gitlab-org/gitlab-shell/notes/905',
times_updated: 2,
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
{
id: '70411b08cdfc01f24187a06d77daa33464cb2620',
reply_id: '70411b08cdfc01f24187a06d77daa33464cb2620',
expanded: true,
notes: [
{
id: '906',
type: null,
attachment: null,
author: {
id: 1,
name: 'Administrator',
username: 'root',
state: 'active',
avatar_url:
'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
path: '/root',
},
created_at: '2018-05-29T12:20:02.925Z',
updated_at: '2018-05-29T12:20:02.925Z',
system: true,
noteable_id: 182,
noteable_type: 'Issue',
resolvable: false,
noteable_iid: 12,
note: 'changed the description',
note_html: '<p dir="auto">changed the description</p>',
current_user: { can_edit: false, can_award_emoji: true },
resolved: false,
resolved_by: null,
system_note_icon_name: 'pencil-square',
discussion_id: '70411b08cdfc01f24187a06d77daa33464cb2620',
emoji_awardable: false,
report_abuse_path:
'/abuse_reports/new?ref_url=http%3A%2F%2Flocalhost%3A3000%2Fgitlab-org%2Fgitlab-shell%2Fissues%2F12%23note_906&user_id=1',
human_access: 'Owner',
path: '/gitlab-org/gitlab-shell/notes/906',
},
],
individual_note: true,
resolvable: false,
resolved: false,
diff_discussion: false,
},
];
export const discussion1 = {
id: 'abc1',
resolvable: true,
resolved: false,
active: true,
diff_file: {
file_path: 'about.md',
},
position: {
new_line: 50,
old_line: null,
},
notes: [
{
created_at: '2018-07-04T16:25:41.749Z',
},
],
};
export const resolvedDiscussion1 = {
id: 'abc1',
resolvable: true,
resolved: true,
diff_file: {
file_path: 'about.md',
},
position: {
new_line: 50,
old_line: null,
},
notes: [
{
created_at: '2018-07-04T16:25:41.749Z',
},
],
};
export const discussion2 = {
id: 'abc2',
resolvable: true,
resolved: false,
active: true,
diff_file: {
file_path: 'README.md',
},
position: {
new_line: null,
old_line: 20,
},
notes: [
{
created_at: '2018-07-04T12:05:41.749Z',
},
],
};
export const discussion3 = {
id: 'abc3',
resolvable: true,
active: true,
resolved: false,
diff_file: {
file_path: 'README.md',
},
position: {
new_line: 21,
old_line: null,
},
notes: [
{
created_at: '2018-07-05T17:25:41.749Z',
},
],
};
export const unresolvableDiscussion = {
resolvable: false,
};
export const discussionFiltersMock = [
{
title: 'Show all activity',
value: 0,
},
{
title: 'Show comments only',
value: 1,
},
{
title: 'Show system notes only',
value: 2,
},
];
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment