mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4338] Add locale to CardViewDateItemModel and improve logic of LocalizedDat… (#4845)
* Add locale to CardViewDateItemModel and improve logic of LocalizedDatePipe * Fix e2e tests * Fix e2e tests * Fix C305010 test
This commit is contained in:
committed by
Eugenio Romano
parent
e03290d26c
commit
334ebd1256
@@ -59,7 +59,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
|
||||
const value = fixture.debugElement.query(By.css('.adf-property-value'));
|
||||
expect(value).not.toBeNull();
|
||||
expect(value.nativeElement.innerText.trim()).toBe('Jul 10 2017');
|
||||
expect(value.nativeElement.innerText.trim()).toBe('Jul 10, 2017');
|
||||
});
|
||||
|
||||
it('should NOT render the default as value if the value is empty, editable:false and displayEmpty is false', () => {
|
||||
@@ -122,7 +122,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
|
||||
const value = fixture.debugElement.query(By.css('.adf-property-value'));
|
||||
expect(value).not.toBeNull();
|
||||
expect(value.nativeElement.innerText.trim()).toBe('Jul 10 2017');
|
||||
expect(value.nativeElement.innerText.trim()).toBe('Jul 10, 2017');
|
||||
});
|
||||
|
||||
it('should render the picker and toggle in case of editable:true', () => {
|
||||
|
@@ -74,8 +74,10 @@ describe('CardViewComponent', () => {
|
||||
|
||||
it('should render the date in the correct format', async(() => {
|
||||
component.properties = [new CardViewDateItemModel({
|
||||
label: 'My date label', value: '2017-06-14', key: 'some key',
|
||||
format: 'MMM DD YYYY'
|
||||
label: 'My date label',
|
||||
value: '2017-06-14',
|
||||
key: 'some key',
|
||||
format: 'short'
|
||||
})];
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
@@ -87,7 +89,7 @@ describe('CardViewComponent', () => {
|
||||
|
||||
const value = fixture.debugElement.query(By.css('.adf-property-value'));
|
||||
expect(value).not.toBeNull();
|
||||
expect(value.nativeElement.innerText).toBe('Jun 14 2017');
|
||||
expect(value.nativeElement.innerText).toBe('6/14/17, 12:00 AM');
|
||||
});
|
||||
}));
|
||||
|
||||
|
Reference in New Issue
Block a user