mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
Fixed test for peer review
This commit is contained in:
parent
13a56bb9fe
commit
c0f57f2b55
@ -154,12 +154,13 @@ describe('DateWidget', () => {
|
|||||||
it('should send field change event when a new date is picked from data picker', (done) => {
|
it('should send field change event when a new date is picked from data picker', (done) => {
|
||||||
let w = new DateWidget(null);
|
let w = new DateWidget(null);
|
||||||
spyOn(w, 'setupMaterialTextField').and.callThrough();
|
spyOn(w, 'setupMaterialTextField').and.callThrough();
|
||||||
w.field = new FormFieldModel(null, {type: 'date'});
|
w.field = new FormFieldModel(null, {value: '9-9-9999', type: 'date'});
|
||||||
w.ngOnInit();
|
w.ngOnInit();
|
||||||
w.datePicker.time = moment();
|
w.datePicker.time = moment('9-9-9999', w.DATE_FORMAT);
|
||||||
w.fieldChanged.subscribe((field) => {
|
w.fieldChanged.subscribe((field) => {
|
||||||
expect(field).toBeDefined();
|
expect(field).toBeDefined();
|
||||||
expect(field).not.toBeNull();
|
expect(field).not.toBeNull();
|
||||||
|
expect(field.value).toEqual('9-9-9999');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
w.onDateSelected();
|
w.onDateSelected();
|
||||||
@ -168,12 +169,13 @@ describe('DateWidget', () => {
|
|||||||
it('should send field change event when date is changed in input text', (done) => {
|
it('should send field change event when date is changed in input text', (done) => {
|
||||||
let w = new DateWidget(null);
|
let w = new DateWidget(null);
|
||||||
spyOn(w, 'setupMaterialTextField').and.callThrough();
|
spyOn(w, 'setupMaterialTextField').and.callThrough();
|
||||||
w.field = new FormFieldModel(null, {type: 'date'});
|
w.field = new FormFieldModel(null, {value: '9-9-9999', type: 'date'});
|
||||||
w.ngOnInit();
|
w.ngOnInit();
|
||||||
w.datePicker.time = moment();
|
w.datePicker.time = moment('9-9-9999', w.DATE_FORMAT);
|
||||||
w.fieldChanged.subscribe((field) => {
|
w.fieldChanged.subscribe((field) => {
|
||||||
expect(field).toBeDefined();
|
expect(field).toBeDefined();
|
||||||
expect(field).not.toBeNull();
|
expect(field).not.toBeNull();
|
||||||
|
expect(field.value).toEqual('9-9-9999');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user