|
@@ -11,7 +11,7 @@ RSpec.describe Import::OTRS::DynamicField::Multiselect, mariadb: true do
|
|
|
zammad_structure = {
|
|
|
object: 'Ticket',
|
|
|
name: 'multiselect_example',
|
|
|
- display: 'Multiselec tExample',
|
|
|
+ display: 'Multiselect Example',
|
|
|
screens: {
|
|
|
view: {
|
|
|
'-all-' => {
|
|
@@ -43,6 +43,88 @@ RSpec.describe Import::OTRS::DynamicField::Multiselect, mariadb: true do
|
|
|
dynamic_field_from_json('multiselect/default', zammad_structure)
|
|
|
end
|
|
|
|
|
|
+ it 'imports an OTRS Multiselect DynamicField with tree mode' do
|
|
|
+ zammad_structure = {
|
|
|
+ object: 'Ticket',
|
|
|
+ name: 'multitreeselect_example',
|
|
|
+ display: 'Multitreeselect Example',
|
|
|
+ screens: {
|
|
|
+ view: {
|
|
|
+ '-all-' => {
|
|
|
+ shown: true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ active: true,
|
|
|
+ editable: true,
|
|
|
+ position: '4',
|
|
|
+ created_by_id: 1,
|
|
|
+ updated_by_id: 1,
|
|
|
+ data_type: 'multi_tree_select',
|
|
|
+ data_option: {
|
|
|
+ default: '',
|
|
|
+ multiple: true,
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ 'value' => 'Level1',
|
|
|
+ 'name' => 'Level 1',
|
|
|
+ 'children' => [
|
|
|
+ { 'value' => 'SubLevel1', 'name' => 'SubLevel 1' },
|
|
|
+ { 'value' => 'SubLevel2', 'name' => 'SubLevel 2' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'value' => 'Level2',
|
|
|
+ 'name' => 'Level 2',
|
|
|
+ 'children' => [
|
|
|
+ { 'value' => 'SubLevel1', 'name' => 'SubLevel 1' },
|
|
|
+ { 'value' => 'SubLevel2', 'name' => 'SubLevel 2' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'value' => 'Support',
|
|
|
+ 'name' => 'Support',
|
|
|
+ 'children' => [
|
|
|
+ {
|
|
|
+ 'value' => 'Level1', 'name' => 'Level 1'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'value' => 'Level2', 'name' => 'Level 2'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'value' => 'Level3', 'name' => 'Level 3'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'value' => 'Finance',
|
|
|
+ 'name' => 'Finance',
|
|
|
+ 'children' => [
|
|
|
+ {
|
|
|
+ 'value' => 'Invoice',
|
|
|
+ 'name' => 'Invoice',
|
|
|
+ 'children' => [
|
|
|
+ {
|
|
|
+ 'value' => 'Germany',
|
|
|
+ 'name' => 'Germany',
|
|
|
+ 'children' => [
|
|
|
+ { 'value' => 'Monthly', 'name' => 'Monthly' }
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ nulloption: false,
|
|
|
+ null: true,
|
|
|
+ translate: false
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ dynamic_field_from_json('multiselect/multi_treeselect', zammad_structure)
|
|
|
+ end
|
|
|
+
|
|
|
context 'without possible values' do
|
|
|
it 'imports no field without possible value' do
|
|
|
allow(ObjectManager::Attribute).to receive(:add)
|