mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-1958] Process Attachment list - The empty list should be a simpl… (#2798)
* [ADF-1958] Process Attachment list - The empty list should be a simple template * changed the default empty list to a simple template * changed process-attachment.component.html so that the user can pass custom empty tempate * [ADF-1958] Process Attachment list - The empty list should be a simple template * changed the default empty list to a simple template * changed process-attachment.component.html so that the user can pass custom empty tempate * removed some unused variables * [ADF-1958] Process Attachment list - The empty list should be a simple template * changed the default empty list to a simple template * changed process-attachment.component.html so that the user can pass custom empty tempate
This commit is contained in:
committed by
Maurizio Vitale
parent
771cea1f11
commit
77822b8494
@@ -15,14 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { NgZone, SimpleChange } from '@angular/core';
|
||||
import { NgZone, SimpleChange, Component } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MatProgressSpinnerModule } from '@angular/material';
|
||||
import { MaterialModule } from '../material.module';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { ProcessContentService } from '@alfresco/adf-core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
||||
import { ProcessAttachmentListComponent } from './process-attachment-list.component';
|
||||
|
||||
describe('ProcessAttachmentListComponent', () => {
|
||||
@@ -202,22 +202,6 @@ describe('ProcessAttachmentListComponent', () => {
|
||||
});
|
||||
}));
|
||||
|
||||
it('should show the empty list drag and drop component when the process is not completed', async(() => {
|
||||
getProcessRelatedContentSpy.and.returnValue(Observable.of({
|
||||
'size': 0,
|
||||
'total': 0,
|
||||
'start': 0,
|
||||
'data': []
|
||||
}));
|
||||
let change = new SimpleChange(null, '123', true);
|
||||
component.ngOnChanges({'processInstanceId': change});
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(fixture.nativeElement.querySelector('adf-empty-list .adf-empty-list-drag_drop').innerText.trim())
|
||||
.toEqual('ADF_PROCESS_LIST.PROCESS-ATTACHMENT.EMPTY.DRAG-AND-DROP.TITLE');
|
||||
});
|
||||
}));
|
||||
|
||||
it('should not show the empty list drag and drop component when is disabled', async(() => {
|
||||
getProcessRelatedContentSpy.and.returnValue(Observable.of({
|
||||
'size': 0,
|
||||
@@ -308,3 +292,45 @@ describe('ProcessAttachmentListComponent', () => {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<adf-process-attachment-list>
|
||||
<adf-empty-list>
|
||||
<div adf-empty-list-header class="adf-empty-list-header">Custom header</div>
|
||||
</adf-empty-list>
|
||||
</adf-process-attachment-list>
|
||||
`
|
||||
})
|
||||
class CustomEmptyTemplateComponent {
|
||||
}
|
||||
|
||||
describe('Custom CustomEmptyTemplateComponent', () => {
|
||||
let fixture: ComponentFixture<CustomEmptyTemplateComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [
|
||||
ProcessAttachmentListComponent,
|
||||
CustomEmptyTemplateComponent
|
||||
],
|
||||
imports: [
|
||||
MaterialModule
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CustomEmptyTemplateComponent);
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should render the custom template', () => {
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
let title: any = fixture.debugElement.queryAll(By.css('[adf-empty-list-header]'));
|
||||
expect(title.length).toBe(1);
|
||||
expect(title[0].nativeElement.innerText).toBe('Custom header');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user