diff --git a/app/javascript/dashboard/helper/specs/actionQueryGenerator.spec.js b/app/javascript/dashboard/helper/specs/actionQueryGenerator.spec.js index 1df314f08..77cfb5d28 100644 --- a/app/javascript/dashboard/helper/specs/actionQueryGenerator.spec.js +++ b/app/javascript/dashboard/helper/specs/actionQueryGenerator.spec.js @@ -9,6 +9,14 @@ const testData = [ action_name: 'add_label_empty', action_params: [], }, + { + action_name: 'add_label_string_array', + action_params: ['test_1', 'test_2', 'test_3'], + }, + { + action_name: 'add_label_number_array', + action_params: [1, 2, 3], + }, { action_name: 'assign_team', action_params: [ @@ -27,13 +35,21 @@ const testData = [ action_params: { id: 'high', name: 'High' }, }, { - action_name: 'test_action_2', - action_params: { value: null, id: 'null', name: 'None' }, + action_name: 'test_action_params_with_id_and_value', + action_params: { value: null, id: 'should-be-skipped', name: 'None' }, }, { - action_name: 'test_action', + action_name: 'test_action_with_no_id_no_value', action_params: { name: 'High' }, }, + { + action_name: 'test_action_with_nullish_action_params', + action_params: null, + }, + { + action_name: 'test_action_with_simple_value_as_action_params', + action_params: 'some-value', + }, ]; const finalResult = [ @@ -45,6 +61,14 @@ const finalResult = [ action_name: 'add_label_empty', action_params: [], }, + { + action_name: 'add_label_string_array', + action_params: ['test_1', 'test_2', 'test_3'], + }, + { + action_name: 'add_label_number_array', + action_params: [1, 2, 3], + }, { action_name: 'assign_team', action_params: [1], @@ -54,17 +78,25 @@ const finalResult = [ action_params: ['high'], }, { - action_name: 'test_action_2', + action_name: 'test_action_params_with_id_and_value', action_params: [null], }, { - action_name: 'test_action', + action_name: 'test_action_with_no_id_no_value', action_params: [ { name: 'High', }, ], }, + { + action_name: 'test_action_with_nullish_action_params', + action_params: [], + }, + { + action_name: 'test_action_with_simple_value_as_action_params', + action_params: ['some-value'], + }, ]; describe('#actionQueryGenerator', () => {