Commit 89c8d226 authored by Olena Horal-Koretska's avatar Olena Horal-Koretska Committed by Brandon Labuschagne

Escalation rule updates do not trigger request parameters recalculation

parent 715fc55a
<script> <script>
import { GlModal, GlAlert } from '@gitlab/ui'; import { GlModal, GlAlert } from '@gitlab/ui';
import { set, isEqual } from 'lodash'; import { isEqual } from 'lodash';
import { s__, __ } from '~/locale'; import { s__, __ } from '~/locale';
import { import {
updateStoreOnEscalationPolicyCreate, updateStoreOnEscalationPolicyCreate,
...@@ -103,7 +103,7 @@ export default { ...@@ -103,7 +103,7 @@ export default {
}; };
}, },
updateForm({ field, value }) { updateForm({ field, value }) {
set(this.form, field, value); this.form = { ...this.form, [field]: value };
this.validateForm(field); this.validateForm(field);
}, },
createEscalationPolicy() { createEscalationPolicy() {
......
...@@ -110,6 +110,7 @@ describe('AddEditsEscalationPolicyModal', () => { ...@@ -110,6 +110,7 @@ describe('AddEditsEscalationPolicyModal', () => {
it('clears the form on modal cancel', async () => { it('clears the form on modal cancel', async () => {
updateForm(); updateForm();
await wrapper.vm.$nextTick();
expect(findEscalationPolicyForm().props('form')).toMatchObject({ expect(findEscalationPolicyForm().props('form')).toMatchObject({
name: updatedName, name: updatedName,
description: updatedDescription, description: updatedDescription,
...@@ -180,6 +181,7 @@ describe('AddEditsEscalationPolicyModal', () => { ...@@ -180,6 +181,7 @@ describe('AddEditsEscalationPolicyModal', () => {
it('clears the form on modal cancel', async () => { it('clears the form on modal cancel', async () => {
updateForm(); updateForm();
await wrapper.vm.$nextTick();
const getForm = () => findEscalationPolicyForm().props('form'); const getForm = () => findEscalationPolicyForm().props('form');
expect(getForm()).toMatchObject({ expect(getForm()).toMatchObject({
name: updatedName, name: updatedName,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment