2020-02-19 09:25:00 +00:00
|
|
|
require 'rails_helper'
|
2020-10-30 07:59:32 +00:00
|
|
|
require 'system/examples/pagination_examples'
|
2020-02-19 09:25:00 +00:00
|
|
|
|
|
|
|
RSpec.describe 'Manage > Trigger', type: :system do
|
|
|
|
|
2020-02-20 12:15:03 +00:00
|
|
|
context 'Selector' do
|
|
|
|
|
|
|
|
context 'custom attribute', db_strategy: :reset do
|
|
|
|
|
|
|
|
it 'enables selection of multiple values for select attribute' do
|
|
|
|
attribute = create_attribute :object_manager_attribute_select,
|
|
|
|
data_option: {
|
|
|
|
options: {
|
|
|
|
'name 1': 'name 1',
|
|
|
|
'name 2': 'name 2',
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
null: false,
|
|
|
|
relation: '',
|
|
|
|
maxlength: 255,
|
|
|
|
nulloption: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
visit '/#manage/trigger'
|
|
|
|
click '.page-header-meta .btn--success'
|
|
|
|
|
|
|
|
modal_ready
|
|
|
|
|
|
|
|
within '.modal .ticket_selector' do
|
|
|
|
find('.js-attributeSelector select').select(attribute.display)
|
|
|
|
|
|
|
|
expect(find('.js-value select')).to be_multiple
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-02-19 09:25:00 +00:00
|
|
|
context 'Perform' do
|
|
|
|
|
|
|
|
context 'Tags' do
|
|
|
|
|
|
|
|
it 'shows tag selection list in foreground' do
|
|
|
|
tag_item = create :tag_item
|
|
|
|
|
|
|
|
visit '/#manage/trigger'
|
2020-06-07 22:31:02 +00:00
|
|
|
click_on 'New Trigger'
|
2020-02-19 09:25:00 +00:00
|
|
|
|
|
|
|
modal_ready
|
|
|
|
|
|
|
|
within '.modal .ticket_perform_action' do
|
|
|
|
find('.js-attributeSelector select').select('Tags')
|
|
|
|
|
|
|
|
input = find('.js-value .token-input')
|
|
|
|
input.fill_in with: tag_item.name.slice(0, 3)
|
|
|
|
end
|
|
|
|
|
|
|
|
expect(page).to have_css('.ui-autocomplete.ui-widget-content') { |elem| !elem.obscured? }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-10-30 07:59:32 +00:00
|
|
|
|
|
|
|
context 'ajax pagination' do
|
|
|
|
include_examples 'pagination', model: :trigger, klass: Trigger, path: 'manage/trigger'
|
|
|
|
end
|
2020-02-19 09:25:00 +00:00
|
|
|
end
|