|
@@ -289,14 +289,6 @@ RSpec.describe 'Manage > Overviews', type: :system do
|
|
|
end
|
|
|
|
|
|
context 'for organization' do
|
|
|
- # let(:condition) do
|
|
|
- # { 'ticket.organization_id' => {
|
|
|
- # operator: operator,
|
|
|
- # pre_condition: 'specific',
|
|
|
- # value: [101, 102, 103]
|
|
|
- # } }
|
|
|
- # end
|
|
|
-
|
|
|
context 'for new overview' do
|
|
|
before do
|
|
|
visit '/#manage/overviews'
|
|
@@ -377,4 +369,60 @@ RSpec.describe 'Manage > Overviews', type: :system do
|
|
|
end
|
|
|
end
|
|
|
end
|
|
|
+
|
|
|
+ # https://github.com/zammad/zammad/issues/4140
|
|
|
+ context 'checking form validation' do
|
|
|
+ shared_examples 'showing the error message if roles are empty' do
|
|
|
+ it 'shows an error message if roles are empty' do
|
|
|
+ in_modal disappears: false do
|
|
|
+ wait.until do
|
|
|
+ page.has_css?('.has-error')
|
|
|
+ find('.has-error').has_content?('is required')
|
|
|
+ end
|
|
|
+ end
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+ context 'when new overview is created' do
|
|
|
+ before do
|
|
|
+ visit '/#manage/overviews'
|
|
|
+ click_on 'New Overview'
|
|
|
+
|
|
|
+ in_modal disappears: false do
|
|
|
+ fill_in 'name', with: 'dummy'
|
|
|
+ click_on 'Submit'
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+ include_examples 'showing the error message if roles are empty'
|
|
|
+ end
|
|
|
+
|
|
|
+ context 'when existing overview is edited' do
|
|
|
+ let(:overview) { create(:overview, role_ids: [role_id]) }
|
|
|
+ let(:role_id) { Role.find_by(name: 'Agent').id }
|
|
|
+
|
|
|
+ before do
|
|
|
+ overview
|
|
|
+
|
|
|
+ visit '/#manage/overviews'
|
|
|
+
|
|
|
+ within '.table-overview .js-tableBody' do
|
|
|
+ find("tr[data-id='#{overview.id}'] td.table-draggable").click
|
|
|
+ end
|
|
|
+
|
|
|
+ in_modal disappears: false do
|
|
|
+ # delete the role and wait for the help message to appear
|
|
|
+ find("div[data-attribute-name='role_ids'] div.js-selected div[data-value='#{role_id}']").click
|
|
|
+
|
|
|
+ wait.until do
|
|
|
+ find("div[data-attribute-name='role_ids'] div.u-placeholder").has_content?('Nothing selected')
|
|
|
+ end
|
|
|
+
|
|
|
+ click_on 'Submit'
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+ include_examples 'showing the error message if roles are empty'
|
|
|
+ end
|
|
|
+ end
|
|
|
end
|