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-07-22 21:08:56 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-22 21:08:56 +0300
commitc25c2a508b3322278c6528685c2af703b29ba170 (patch)
treefe7aba0d3633225baa308cb647c9cc7b4b455e3a /spec/frontend/boards/components
parent632d0734750382e7c4e5f1b3c526a94acf6e7ce2 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/boards/components')
-rw-r--r--spec/frontend/boards/components/board_add_new_column_form_spec.js28
1 files changed, 23 insertions, 5 deletions
diff --git a/spec/frontend/boards/components/board_add_new_column_form_spec.js b/spec/frontend/boards/components/board_add_new_column_form_spec.js
index 3b26ca57d6f..7855b041951 100644
--- a/spec/frontend/boards/components/board_add_new_column_form_spec.js
+++ b/spec/frontend/boards/components/board_add_new_column_form_spec.js
@@ -61,7 +61,7 @@ describe('Board card layout', () => {
const formTitle = () => wrapper.findByTestId('board-add-column-form-title').text();
const findSearchInput = () => wrapper.find(GlSearchBoxByType);
- const findSearchLabel = () => wrapper.find(GlFormGroup);
+ const findSearchLabelFormGroup = () => wrapper.find(GlFormGroup);
const cancelButton = () => wrapper.findByTestId('cancelAddNewColumn');
const submitButton = () => wrapper.findByTestId('addNewColumnButton');
const findDropdown = () => wrapper.findComponent(GlDropdown);
@@ -121,10 +121,17 @@ describe('Board card layout', () => {
mountComponent(props);
- expect(findSearchLabel().attributes('label')).toEqual(props.searchLabel);
+ expect(findSearchLabelFormGroup().attributes('label')).toEqual(props.searchLabel);
expect(findSearchInput().attributes('placeholder')).toEqual(props.searchPlaceholder);
});
+ it('does not show the dropdown as invalid by default', () => {
+ mountComponent();
+
+ expect(findSearchLabelFormGroup().attributes('state')).toBe('true');
+ expect(findDropdown().props('toggleClass')).not.toContain('gl-inset-border-1-red-400!');
+ });
+
it('emits filter event on input', () => {
mountComponent();
@@ -137,13 +144,13 @@ describe('Board card layout', () => {
});
describe('Add list button', () => {
- it('is disabled if no item is selected', () => {
+ it('is enabled by default', () => {
mountComponent();
- expect(submitButton().props('disabled')).toBe(true);
+ expect(submitButton().props('disabled')).toBe(false);
});
- it('emits add-list event on click', () => {
+ it('emits add-list event on click when an ID is selected', () => {
mountComponent({
selectedId: mockLabelList.label.id,
});
@@ -152,5 +159,16 @@ describe('Board card layout', () => {
expect(wrapper.emitted('add-list')).toEqual([[]]);
});
+
+ it('does not emit the add-list event on click and shows the dropdown as invalid when no ID is selected', async () => {
+ mountComponent();
+
+ await submitButton().vm.$emit('click');
+
+ expect(findSearchLabelFormGroup().attributes('state')).toBeUndefined();
+ expect(findDropdown().props('toggleClass')).toContain('gl-inset-border-1-red-400!');
+
+ expect(wrapper.emitted('add-list')).toBeUndefined();
+ });
});
});