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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-10 15:08:15 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-10 15:08:15 +0300
commitbe2696666feee6e1045e0991309b71ce7f38a413 (patch)
tree9078d7b0fb2d9ed14e22fbf783f75db4666c67e7 /spec/frontend/issues
parent1f64fe671ba1a368ff7e67948448b4805cdfc2db (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/issues')
-rw-r--r--spec/frontend/issues/list/components/issues_list_app_spec.js1
-rw-r--r--spec/frontend/issues/list/mock_data.js9
-rw-r--r--spec/frontend/issues/show/components/incidents/timeline_events_form_spec.js30
3 files changed, 39 insertions, 1 deletions
diff --git a/spec/frontend/issues/list/components/issues_list_app_spec.js b/spec/frontend/issues/list/components/issues_list_app_spec.js
index fa0195ed765..a5488941791 100644
--- a/spec/frontend/issues/list/components/issues_list_app_spec.js
+++ b/spec/frontend/issues/list/components/issues_list_app_spec.js
@@ -89,7 +89,6 @@ describe('CE IssuesListApp component', () => {
hasIssuableHealthStatusFeature: true,
hasIssueWeightsFeature: true,
hasIterationsFeature: true,
- hasMultipleIssueAssigneesFeature: true,
hasScopedLabelsFeature: true,
initialEmail: 'email@example.com',
initialSort: CREATED_DESC,
diff --git a/spec/frontend/issues/list/mock_data.js b/spec/frontend/issues/list/mock_data.js
index 42e9d348b16..e80191a95c8 100644
--- a/spec/frontend/issues/list/mock_data.js
+++ b/spec/frontend/issues/list/mock_data.js
@@ -1,6 +1,7 @@
import {
OPERATOR_IS,
OPERATOR_IS_NOT,
+ OPERATOR_OR,
} from '~/vue_shared/components/filtered_search_bar/constants';
export const getIssuesQueryResponse = {
@@ -122,6 +123,8 @@ export const locationSearch = [
'assignee_username[]=5',
'not[assignee_username][]=patty',
'not[assignee_username][]=selma',
+ 'or[assignee_username][]=carl',
+ 'or[assignee_username][]=lenny',
'milestone_title=season+3',
'milestone_title=season+4',
'not[milestone_title]=season+20',
@@ -173,6 +176,8 @@ export const filteredTokens = [
{ type: 'assignee_username', value: { data: '5', operator: OPERATOR_IS } },
{ type: 'assignee_username', value: { data: 'patty', operator: OPERATOR_IS_NOT } },
{ type: 'assignee_username', value: { data: 'selma', operator: OPERATOR_IS_NOT } },
+ { type: 'assignee_username', value: { data: 'carl', operator: OPERATOR_OR } },
+ { type: 'assignee_username', value: { data: 'lenny', operator: OPERATOR_OR } },
{ type: 'milestone', value: { data: 'season 3', operator: OPERATOR_IS } },
{ type: 'milestone', value: { data: 'season 4', operator: OPERATOR_IS } },
{ type: 'milestone', value: { data: 'season 20', operator: OPERATOR_IS_NOT } },
@@ -244,6 +249,9 @@ export const apiParams = {
epicId: '34',
weight: '3',
},
+ or: {
+ assigneeUsernames: ['carl', 'lenny'],
+ },
};
export const apiParamsWithSpecialValues = {
@@ -263,6 +271,7 @@ export const urlParams = {
'not[author_username]': 'marge',
'assignee_username[]': ['bart', 'lisa', '5'],
'not[assignee_username][]': ['patty', 'selma'],
+ 'or[assignee_username][]': ['carl', 'lenny'],
milestone_title: ['season 3', 'season 4'],
'not[milestone_title]': ['season 20', 'season 30'],
'label_name[]': ['cartoon', 'tv'],
diff --git a/spec/frontend/issues/show/components/incidents/timeline_events_form_spec.js b/spec/frontend/issues/show/components/incidents/timeline_events_form_spec.js
index 2e7449974e5..0ce3f75f576 100644
--- a/spec/frontend/issues/show/components/incidents/timeline_events_form_spec.js
+++ b/spec/frontend/issues/show/components/incidents/timeline_events_form_spec.js
@@ -52,6 +52,9 @@ describe('Timeline events form', () => {
findMinuteInput().setValue(45);
};
const findTextarea = () => wrapper.findByTestId('input-note');
+ const findCountNumeric = (count) => wrapper.findByText(count);
+ const findCountVerbose = (count) => wrapper.findByText(`${count} characters remaining`);
+ const findCountHint = () => wrapper.findByText(timelineFormI18n.hint);
const submitForm = async () => {
findSubmitButton().vm.$emit('click');
@@ -135,4 +138,31 @@ describe('Timeline events form', () => {
expect(findSubmitAndAddButton().props('disabled')).toBe(false);
});
});
+
+ describe('form character limit', () => {
+ beforeEach(() => {
+ mountComponent({ mountMethod: mountExtended });
+ });
+
+ it('sets a character limit hint', () => {
+ expect(findCountHint().exists()).toBe(true);
+ });
+
+ it('sets a character limit when text is entered', async () => {
+ await findTextarea().setValue('hello');
+
+ expect(findCountNumeric('275').text()).toBe('275');
+ expect(findCountVerbose('275').text()).toBe('275 characters remaining');
+ });
+
+ it('prevents form submission when text is beyond maximum length', async () => {
+ // 281 characters long
+ const longText =
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in volupte';
+ await findTextarea().setValue(longText);
+
+ expect(findSubmitButton().props('disabled')).toBe(true);
+ expect(findSubmitAndAddButton().props('disabled')).toBe(true);
+ });
+ });
});