Fix spec fixtures

This commit is contained in:
Fayaz Ahmed 2022-05-31 11:39:30 +05:30
parent ea5e7ce6ba
commit 40a7681d45
3 changed files with 5 additions and 18 deletions

View file

@ -656,6 +656,7 @@ export const automationToSubmit = {
filter_operator: 'equal_to',
values: [{ id: 'open', name: 'Open' }],
query_operator: 'and',
custom_attribute_type: '',
},
],
actions: [

View file

@ -187,6 +187,7 @@ describe('automationMethodsMixin', () => {
filter_operator: 'equal_to',
values: '',
query_operator: 'and',
custom_attribute_type: '',
},
];
const genericConditionModel = [
@ -195,6 +196,7 @@ describe('automationMethodsMixin', () => {
filter_operator: 'equal_to',
values: '',
query_operator: 'and',
custom_attribute_type: '',
},
];
expect(helpers.getDefaultConditions('message_created')).toEqual(

View file

@ -193,6 +193,7 @@ describe('automationMethodsMixin', () => {
filter_operator: 'equal_to',
values: '',
query_operator: 'and',
custom_attribute_type: '',
};
const data = () => {
return {
@ -287,24 +288,7 @@ describe('automationMethodsMixin', () => {
filter_operator: 'equal_to',
values: '',
query_operator: 'and',
};
const wrapper = createComponent([methodsMixin], data);
wrapper.vm.resetFilter(0, automationToSubmit.conditions[0]);
expect(automation.conditions[0]).toEqual(conditionAfterReset);
});
it('resetFilter resets the current automation conditions', () => {
const data = () => {
return {
automation: automationToSubmit,
automationTypes: AUTOMATIONS,
};
};
const conditionAfterReset = {
attribute_key: 'status',
filter_operator: 'equal_to',
values: '',
query_operator: 'and',
custom_attribute_type: '',
};
const wrapper = createComponent([methodsMixin], data);
wrapper.vm.resetFilter(0, automationToSubmit.conditions[0]);