TSK-614 BUG Update accesItemsClone onReset access items form.
- Update accesItemsClone onReset access items form.
This commit is contained in:
parent
2725d29191
commit
7c79bca35c
|
@ -129,4 +129,14 @@ describe('AccessItemsComponent', () => {
|
|||
new AlertModel(AlertType.SUCCESS, `Workbasket ${component.workbasket.key} Access items were saved successfully`));
|
||||
});
|
||||
|
||||
|
||||
it('should keep accessItemsClone length to previous value after clearing the form.', () => {
|
||||
expect(component.accessItemsClone.length).toBe(2);
|
||||
component.remove(1);
|
||||
expect(component.accessItemsClone.length).toBe(1);
|
||||
component.clear();
|
||||
expect(component.accessItemsClone.length).toBe(2);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -130,9 +130,10 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
|
|||
}
|
||||
|
||||
clear() {
|
||||
this.alertService.triggerAlert(new AlertModel(AlertType.INFO, 'Reset edited fields'))
|
||||
this.AccessItemsForm.reset();
|
||||
this.setAccessItemsGroups(this.accessItemsResetClone);
|
||||
this.accessItemsClone = this.cloneAccessItems(this.accessItemsResetClone);
|
||||
this.alertService.triggerAlert(new AlertModel(AlertType.INFO, 'Reset edited fields'))
|
||||
}
|
||||
|
||||
remove(index: number) {
|
||||
|
|
Loading…
Reference in New Issue