mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-587] upgrade components to angular 4 (#1866)
[ADF-587] upgrade components to angular 4
This commit is contained in:
committed by
Eugenio Romano
parent
5ba1202292
commit
e29741d18d
@@ -137,7 +137,7 @@ describe('ActivitiContent', () => {
|
||||
});
|
||||
|
||||
let contentId = 1;
|
||||
let change = new SimpleChange(null, contentId);
|
||||
let change = new SimpleChange(null, contentId, true);
|
||||
component.ngOnChanges({ 'id': change });
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
@@ -180,7 +180,7 @@ describe('ActivitiContent', () => {
|
||||
});
|
||||
|
||||
let contentId = 1;
|
||||
let change = new SimpleChange(null, contentId);
|
||||
let change = new SimpleChange(null, contentId, true);
|
||||
component.ngOnChanges({'id': change});
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
@@ -208,7 +208,7 @@ describe('ActivitiContent', () => {
|
||||
it('should show unsupported preview with unsupported file', (done) => {
|
||||
|
||||
let contentId = 1;
|
||||
let change = new SimpleChange(null, contentId);
|
||||
let change = new SimpleChange(null, contentId, true);
|
||||
component.ngOnChanges({'id': change});
|
||||
|
||||
component.contentLoaded.subscribe((res) => {
|
||||
|
@@ -258,7 +258,7 @@ describe('ActivitiForm', () => {
|
||||
spyOn(formComponent, 'getFormByTaskId').and.stub();
|
||||
const taskId = '<task id>';
|
||||
|
||||
let change = new SimpleChange(null, taskId);
|
||||
let change = new SimpleChange(null, taskId, true);
|
||||
formComponent.ngOnChanges({'taskId': change});
|
||||
|
||||
expect(formComponent.getFormByTaskId).toHaveBeenCalledWith(taskId);
|
||||
@@ -268,7 +268,7 @@ describe('ActivitiForm', () => {
|
||||
spyOn(formComponent, 'getFormDefinitionByFormId').and.stub();
|
||||
const formId = '123';
|
||||
|
||||
let change = new SimpleChange(null, formId);
|
||||
let change = new SimpleChange(null, formId, true);
|
||||
formComponent.ngOnChanges({'formId': change});
|
||||
|
||||
expect(formComponent.getFormDefinitionByFormId).toHaveBeenCalledWith(formId);
|
||||
@@ -278,7 +278,7 @@ describe('ActivitiForm', () => {
|
||||
spyOn(formComponent, 'getFormDefinitionByFormName').and.stub();
|
||||
const formName = '<form>';
|
||||
|
||||
let change = new SimpleChange(null, formName);
|
||||
let change = new SimpleChange(null, formName, true);
|
||||
formComponent.ngOnChanges({'formName': change});
|
||||
|
||||
expect(formComponent.getFormDefinitionByFormName).toHaveBeenCalledWith(formName);
|
||||
@@ -304,7 +304,7 @@ describe('ActivitiForm', () => {
|
||||
spyOn(formComponent, 'getFormDefinitionByFormId').and.stub();
|
||||
spyOn(formComponent, 'getFormDefinitionByFormName').and.stub();
|
||||
|
||||
formComponent.ngOnChanges({'tag': new SimpleChange(null, 'hello world')});
|
||||
formComponent.ngOnChanges({'tag': new SimpleChange(null, 'hello world', true)});
|
||||
|
||||
expect(formComponent.getFormByTaskId).not.toHaveBeenCalled();
|
||||
expect(formComponent.getFormDefinitionByFormId).not.toHaveBeenCalled();
|
||||
|
@@ -77,19 +77,19 @@ describe('ActivitiStartForm', () => {
|
||||
|
||||
it('should load start form on change if processDefinitionId defined', () => {
|
||||
component.processDefinitionId = exampleId1;
|
||||
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2) });
|
||||
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2, true) });
|
||||
expect(formService.getStartFormDefinition).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should load start form when processDefinitionId changed', () => {
|
||||
component.processDefinitionId = exampleId1;
|
||||
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2) });
|
||||
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2, true) });
|
||||
expect(formService.getStartFormDefinition).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should not load start form when changes notified but no change to processDefinitionId', () => {
|
||||
component.processDefinitionId = exampleId1;
|
||||
component.ngOnChanges({ otherProp: new SimpleChange(exampleId1, exampleId2) });
|
||||
component.ngOnChanges({ otherProp: new SimpleChange(exampleId1, exampleId2, true) });
|
||||
expect(formService.getStartFormDefinition).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -110,7 +110,7 @@ describe('ActivitiStartForm', () => {
|
||||
}));
|
||||
component.processDefinitionId = exampleId1;
|
||||
component.ngOnInit();
|
||||
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2) });
|
||||
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2, true) });
|
||||
fixture.detectChanges();
|
||||
expect(component.outcomesContainer).toBeTruthy();
|
||||
});
|
||||
@@ -126,7 +126,7 @@ describe('ActivitiStartForm', () => {
|
||||
}));
|
||||
component.processDefinitionId = exampleId1;
|
||||
component.showOutcomeButtons = true;
|
||||
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2) });
|
||||
component.ngOnChanges({ processDefinitionId: new SimpleChange(exampleId1, exampleId2, true) });
|
||||
fixture.detectChanges();
|
||||
expect(component.outcomesContainer).toBeTruthy();
|
||||
});
|
||||
|
Reference in New Issue
Block a user