fix random test failing part 2 (#3395)

* fix random failing test core search/comment/auth/user

* fix node delete directive

* fix lint issues

* node restore fix

* fix comment test

* remove fdescribe

* fix tests and tslint

* fix upload test

* unsubscribe success event task test

* copy comment object during test

* use the data pipe performance improvement and standard usage

* uncomment random test

* fix comment date random failing test

* disposable unsubscribe

* fix start process

* remove fdescribe

* change start process test and remove commented code

* fix error event check double click

* clone object form test

* refactor date time test

* fix service mock

* fix test dropdown and context

* git hook lint

* fix language test

* unsubscribe documentlist event test

* fix disposable error

* fix console log service error document list

* unusbscribe search test

* clear input field

* remove wrong test
This commit is contained in:
Eugenio Romano
2018-05-29 11:18:17 +02:00
committed by Denys Vuika
parent 22006395c7
commit eb0f91c5db
43 changed files with 4475 additions and 4332 deletions

View File

@@ -32,6 +32,7 @@ describe('TaskAttachmentList', () => {
let mockAttachment: any;
let deleteContentSpy: jasmine.Spy;
let getFileRawContentSpy: jasmine.Spy;
let disposablelSuccess: any;
setupTestBed({
imports: [ProcessTestingModule],
@@ -83,7 +84,7 @@ describe('TaskAttachmentList', () => {
mockAttachment
));
deleteContentSpy = spyOn(service, 'deleteRelatedContent').and.returnValue(Observable.of({successCode: true}));
deleteContentSpy = spyOn(service, 'deleteRelatedContent').and.returnValue(Observable.of({ successCode: true }));
let blobObj = new Blob();
getFileRawContentSpy = spyOn(service, 'getFileRawContent').and.returnValue(Observable.of(blobObj));
@@ -94,6 +95,10 @@ describe('TaskAttachmentList', () => {
overlayContainers.forEach((overlayContainer) => {
overlayContainer.innerHTML = '';
});
if (disposablelSuccess) {
disposablelSuccess.unsubscribe();
}
});
it('should load attachments when taskId specified', () => {
@@ -112,7 +117,7 @@ describe('TaskAttachmentList', () => {
it('should emit a success event when the attachments are loaded', () => {
let change = new SimpleChange(null, '123', true);
component.success.subscribe((attachments) => {
disposablelSuccess = component.success.subscribe((attachments) => {
expect(attachments[0].name).toEqual(mockAttachment.data[0].name);
expect(attachments[0].id).toEqual(mockAttachment.data[0].id);
});
@@ -307,12 +312,12 @@ describe('TaskAttachmentList', () => {
@Component({
template: `
<adf-task-attachment-list>
<adf-empty-list>
<div adf-empty-list-header class="adf-empty-list-header">Custom header</div>
</adf-empty-list>
</adf-task-attachment-list>
`
<adf-task-attachment-list>
<adf-empty-list>
<div adf-empty-list-header class="adf-empty-list-header">Custom header</div>
</adf-empty-list>
</adf-task-attachment-list>
`
})
class CustomEmptyTemplateComponent {
}
@@ -323,7 +328,7 @@ describe('Custom CustomEmptyTemplateComponent', () => {
setupTestBed({
imports: [ProcessTestingModule],
declarations: [CustomEmptyTemplateComponent],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
schemas: [CUSTOM_ELEMENTS_SCHEMA]
});
beforeEach(() => {