[ADF-4522] Metadata value is not rolled back upon error (#5550)

* * initial commit

* * removed breaking change

* * fixed ts

* * fixed minor changes

* * fixed changes

* * minor changes

* * fixed unit test

* * docs added

* * fixed date clear problem

* * fixed unit test
This commit is contained in:
dhrn
2020-03-17 16:17:08 +05:30
committed by GitHub
parent becf45d150
commit d720d36670
18 changed files with 191 additions and 65 deletions

View File

@@ -189,10 +189,11 @@ describe('CardViewDateItemComponent', () => {
const cardViewUpdateService = TestBed.get(CardViewUpdateService);
const expectedDate = moment('Jul 10 2017', 'MMM DD YY');
fixture.detectChanges();
const property = { ...component.property };
const disposableUpdate = cardViewUpdateService.itemUpdated$.subscribe(
(updateNotification) => {
expect(updateNotification.target).toBe(component.property);
expect(updateNotification.target).toEqual(property);
expect(updateNotification.changed).toEqual({ dateKey: expectedDate.toDate() });
disposableUpdate.unsubscribe();
done();
@@ -287,10 +288,11 @@ describe('CardViewDateItemComponent', () => {
component.property.value = 'Jul 10 2017';
fixture.detectChanges();
const cardViewUpdateService = TestBed.get(CardViewUpdateService);
const property = { ...component.property };
const disposableUpdate = cardViewUpdateService.itemUpdated$.subscribe(
(updateNotification) => {
expect(updateNotification.target).toBe(component.property);
expect(updateNotification.target).toEqual(property);
expect(updateNotification.changed).toEqual({ dateKey: null });
disposableUpdate.unsubscribe();
}