[ADF-3066] ProcessList Component - Empty State issue. (#3434)

This commit is contained in:
camorra-skk
2018-06-05 21:16:18 +05:30
committed by Eugenio Romano
parent 35d2a0b683
commit 4225bf5213
7 changed files with 70 additions and 14 deletions

View File

@@ -15,9 +15,11 @@
* limitations under the License.
*/
import { Component, SimpleChange, ViewChild } from '@angular/core';
import { Component, SimpleChange, ViewChild, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
import { Observable } from 'rxjs/Observable';
import { By } from '@angular/platform-browser';
import { ProcessInstanceListComponent } from './process-list.component';
import { AppConfigService, setupTestBed, CoreModule } from '@alfresco/adf-core';
@@ -552,3 +554,42 @@ describe('CustomProcessListComponent', () => {
expect(component.processList.data.getColumns().length).toEqual(3);
});
});
@Component({
template: `
<adf-process-instance-list>
<adf-empty-content-holder>
<p id="custom-id"> No Process Instance</p>
</adf-empty-content-holder>
</adf-process-instance-list>
`
})
class EmptyTemplateComponent {
}
describe('Custom EmptyTemplateComponent', () => {
let component: EmptyTemplateComponent;
let fixture: ComponentFixture<EmptyTemplateComponent>;
setupTestBed({
imports: [ProcessTestingModule],
declarations: [EmptyTemplateComponent],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
});
beforeEach(() => {
fixture = TestBed.createComponent(EmptyTemplateComponent);
fixture.detectChanges();
component = fixture.componentInstance;
});
it('should render the custom template', async(() => {
fixture.whenStable().then(() => {
fixture.detectChanges();
let title = fixture.debugElement.query(By.css('#custom-id'));
expect(title).not.toBeNull();
expect(title.nativeElement.innerText).toBe('No Process Instance');
expect(fixture.debugElement.query(By.css('.adf-empty-content'))).toBeNull();
});
}));
});