reintroduce viewer test (#3888)

This commit is contained in:
Eugenio Romano
2018-10-16 08:35:05 +01:00
committed by GitHub
parent 094e1dab91
commit 0fc504b69e
9 changed files with 77 additions and 75 deletions

View File

@@ -130,15 +130,16 @@ describe('TaskAttachmentList', () => {
expect(getTaskRelatedContentSpy).not.toHaveBeenCalled();
});
it('should display attachments when the task has attachments', async(() => {
it('should display attachments when the task has attachments', (done) => {
let change = new SimpleChange(null, '123', true);
component.ngOnChanges({ 'taskId': change });
fixture.detectChanges();
fixture.whenStable().then(() => {
expect(fixture.debugElement.queryAll(By.css('.adf-datatable-body > .adf-datatable-row')).length).toBe(2);
done();
});
}));
});
it('emit document when a user wants to view the document', () => {
component.emitDocumentContent(mockAttachment.data[1]);
@@ -271,13 +272,14 @@ describe('TaskAttachmentList', () => {
});
}));
it('should fetch new attachments when taskId changed', async(() => {
it('should fetch new attachments when taskId changed', (done) => {
fixture.detectChanges();
fixture.whenStable().then(() => {
component.ngOnChanges({ 'taskId': change });
expect(getTaskRelatedContentSpy).toHaveBeenCalledWith('456');
done();
});
}));
});
it('should NOT fetch new attachments when empty change set made', () => {
component.ngOnChanges({});

View File

@@ -71,7 +71,7 @@ module.exports = function (config) {
},
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_DEBUG,
logLevel: config.LOG_INFO,
colors: true,
@@ -95,9 +95,6 @@ module.exports = function (config) {
reporters: ['mocha', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});