diff options
author | Phil Hughes <me@iamphill.com> | 2018-01-18 12:00:10 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-01-18 12:00:10 +0300 |
commit | f82ccd631624216e675238fc7ae5b60cb6be0f98 (patch) | |
tree | 07559bf005fee1d544943ae638a511d81f702c2f /spec | |
parent | a4eb71dcfabbb27df1d4461cbb924ff1a4c3b1b8 (diff) | |
parent | dd49a4284ab8681d0df6b984ad654028c360f9a1 (diff) |
Merge branch '34252-trailing-plus' into 'master'
Resolve "Cannot filter issues by labels ending with a plus char in board view"
Closes #41715 and #34252
See merge request gitlab-org/gitlab-ce!16490
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/boards/boards_spec.rb | 11 | ||||
-rw-r--r-- | spec/javascripts/boards/utils/query_data_spec.js | 27 |
2 files changed, 38 insertions, 0 deletions
diff --git a/spec/features/boards/boards_spec.rb b/spec/features/boards/boards_spec.rb index 3876d1c76d7..3d13f806b11 100644 --- a/spec/features/boards/boards_spec.rb +++ b/spec/features/boards/boards_spec.rb @@ -69,6 +69,7 @@ describe 'Issue Boards', :js do let!(:backlog) { create(:label, project: project, name: 'Backlog') } let!(:closed) { create(:label, project: project, name: 'Closed') } let!(:accepting) { create(:label, project: project, name: 'Accepting Merge Requests') } + let!(:a_plus) { create(:label, project: project, name: 'A+') } let!(:list1) { create(:list, board: board, label: planning, position: 0) } let!(:list2) { create(:list, board: board, label: development, position: 1) } @@ -83,6 +84,7 @@ describe 'Issue Boards', :js do let!(:issue7) { create(:labeled_issue, project: project, title: 'ggg', description: '777', labels: [development], relative_position: 2) } let!(:issue8) { create(:closed_issue, project: project, title: 'hhh', description: '888') } let!(:issue9) { create(:labeled_issue, project: project, title: 'iii', description: '999', labels: [planning, testing, bug, accepting], relative_position: 1) } + let!(:issue10) { create(:labeled_issue, project: project, title: 'issue +', description: 'A+ great issue', labels: [a_plus]) } before do visit project_board_path(project, board) @@ -400,6 +402,15 @@ describe 'Issue Boards', :js do wait_for_empty_boards((3..4)) end + it 'filters by label with encoded character' do + set_filter("label", a_plus.title) + click_filter_link(a_plus.title) + submit_filter + + wait_for_board_cards(1, 1) + wait_for_empty_boards((2..4)) + end + it 'filters by label with space after reload' do set_filter("label", "\"#{accepting.title}") click_filter_link(accepting.title) diff --git a/spec/javascripts/boards/utils/query_data_spec.js b/spec/javascripts/boards/utils/query_data_spec.js new file mode 100644 index 00000000000..922215ffc1d --- /dev/null +++ b/spec/javascripts/boards/utils/query_data_spec.js @@ -0,0 +1,27 @@ +import queryData from '~/boards/utils/query_data'; + +describe('queryData', () => { + it('parses path for label with trailing +', () => { + expect( + queryData('label_name[]=label%2B', {}), + ).toEqual({ + label_name: ['label+'], + }); + }); + + it('parses path for milestone with trailing +', () => { + expect( + queryData('milestone_title=A%2B', {}), + ).toEqual({ + milestone_title: 'A+', + }); + }); + + it('parses path for search terms with spaces', () => { + expect( + queryData('search=two+words', {}), + ).toEqual({ + search: 'two words', + }); + }); +}); |