mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
modification of test cases as per endof the day changes in new code
This commit is contained in:
+4
-3
@@ -192,6 +192,7 @@ describe('CardViewDateItemComponent', () => {
|
|||||||
const itemUpdatedSpy = spyOn(cardViewUpdateService.itemUpdated$, 'next');
|
const itemUpdatedSpy = spyOn(cardViewUpdateService.itemUpdated$, 'next');
|
||||||
component.editable = true;
|
component.editable = true;
|
||||||
component.property.editable = true;
|
component.property.editable = true;
|
||||||
|
component.property.value = moment('Jul 10 2017', 'MMM DD YYYY').endOf('day').toDate();
|
||||||
const expectedDate = moment('Jul 10 2017', 'MMM DD YYYY');
|
const expectedDate = moment('Jul 10 2017', 'MMM DD YYYY');
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const property = { ...component.property };
|
const property = { ...component.property };
|
||||||
@@ -200,7 +201,7 @@ describe('CardViewDateItemComponent', () => {
|
|||||||
expect(itemUpdatedSpy).toHaveBeenCalledWith({
|
expect(itemUpdatedSpy).toHaveBeenCalledWith({
|
||||||
target: property,
|
target: property,
|
||||||
changed: {
|
changed: {
|
||||||
dateKey: expectedDate.toDate()
|
dateKey: expectedDate.endOf('day').toDate()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -215,7 +216,7 @@ describe('CardViewDateItemComponent', () => {
|
|||||||
component.onDateChanged({ value: expectedDate });
|
component.onDateChanged({ value: expectedDate });
|
||||||
|
|
||||||
await fixture.whenStable();
|
await fixture.whenStable();
|
||||||
expect(component.property.value).toEqual(expectedDate.toDate());
|
expect(component.property.value).toEqual(expectedDate.endOf('day').toDate());
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should copy value to clipboard on double click', () => {
|
it('should copy value to clipboard on double click', () => {
|
||||||
@@ -332,7 +333,7 @@ describe('CardViewDateItemComponent', () => {
|
|||||||
component.onDateChanged({ value: expectedDate });
|
component.onDateChanged({ value: expectedDate });
|
||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(component.property.value).toEqual(expectedDate.toDate());
|
expect(component.property.value).toEqual(expectedDate.endOf('day').toDate());
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render chips for multivalue dates when chips are enabled', async () => {
|
it('should render chips for multivalue dates when chips are enabled', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user