[ADF-5076] Automate tastrail case (#5463)

This commit is contained in:
dhrn
2020-02-10 19:32:57 +05:30
committed by GitHub
parent c84bb250fb
commit e46466a885
3 changed files with 209 additions and 2 deletions

View File

@@ -283,4 +283,25 @@ describe('CardViewDateItemComponent', () => {
}
);
}));
it('should be possible update a date/date-time', async(() => {
component.editable = true;
component.property.editable = true;
component.property.default = 'Jul 10 2017';
component.property.key = 'fake-key';
component.property.value = 'Jul 10 2017';
const expectedDate = moment('Jul 10 2018', 'MMM DD YY');
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
const element = fixture.debugElement.nativeElement.querySelector('span[data-automation-id="card-date-value-fake-key"]');
expect(element).toBeDefined();
expect(element.innerText).toEqual('Jul 10, 2017');
component.onDateChanged({ value: expectedDate });
fixture.detectChanges();
fixture.whenStable().then(() => expect(component.property.value).toEqual(expectedDate.toDate()));
});
}));
});