clean unit test (#4890)

* promote use setupTestbed

* fix comment using right spy and remove deprecated moment method usage

* restore md icon file

* remove error translation log

* restore extension test
This commit is contained in:
Eugenio Romano
2019-07-02 16:00:58 +01:00
committed by GitHub
parent 87b80235a7
commit 0d6140be77
17 changed files with 208 additions and 226 deletions

View File

@@ -15,23 +15,22 @@
* limitations under the License.
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NameLocationCellComponent } from './name-location-cell.component';
import { By } from '@angular/platform-browser';
import { DataRow } from '@alfresco/adf-core';
import { setupTestBed } from '../../../core/testing/setupTestBed';
describe('NameLocationCellComponent', () => {
let component: NameLocationCellComponent;
let fixture: ComponentFixture<NameLocationCellComponent>;
let rowData: DataRow;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
NameLocationCellComponent
]
}).compileComponents();
}));
setupTestBed({
declarations: [
NameLocationCellComponent
]
});
beforeEach(() => {
fixture = TestBed.createComponent(NameLocationCellComponent);

View File

@@ -19,19 +19,18 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FileModel, CoreModule, FileUploadOptions, FileUploadStatus } from '@alfresco/adf-core';
import { UploadModule } from '../upload.module';
import { FileUploadingListRowComponent } from './file-uploading-list-row.component';
import { setupTestBed } from '../../../core/testing/setupTestBed';
describe('FileUploadingListRowComponent', () => {
let fixture: ComponentFixture<FileUploadingListRowComponent>;
let component: FileUploadingListRowComponent;
const file = new FileModel(<File> { name: 'fake-name' });
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
CoreModule.forRoot(),
UploadModule
]
}).compileComponents();
setupTestBed({
imports: [
CoreModule.forRoot(),
UploadModule
]
});
beforeEach(() => {