mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
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:
@@ -23,6 +23,7 @@ import { ContextMenuModule } from './context-menu.module';
|
||||
import { ContextMenuService } from './context-menu.service';
|
||||
import { CoreModule } from '../core.module';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { setupTestBed } from '../testing/setupTestBed';
|
||||
|
||||
describe('ContextMenuHolderComponent', () => {
|
||||
let fixture: ComponentFixture<ContextMenuHolderComponent>;
|
||||
@@ -52,25 +53,25 @@ describe('ContextMenuHolderComponent', () => {
|
||||
})
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
CoreModule.forRoot(),
|
||||
ContextMenuModule
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: OverlayContainer,
|
||||
useValue: overlayContainer
|
||||
},
|
||||
{
|
||||
provide: ViewportRuler,
|
||||
useValue: getViewportRect
|
||||
}
|
||||
]
|
||||
});
|
||||
setupTestBed({
|
||||
imports: [
|
||||
NoopAnimationsModule,
|
||||
CoreModule.forRoot(),
|
||||
ContextMenuModule
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
provide: OverlayContainer,
|
||||
useValue: overlayContainer
|
||||
},
|
||||
{
|
||||
provide: ViewportRuler,
|
||||
useValue: getViewportRect
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ContextMenuHolderComponent);
|
||||
component = fixture.componentInstance;
|
||||
contextMenuService = TestBed.get(ContextMenuService);
|
||||
|
@@ -15,12 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { Overlay } from '@angular/cdk/overlay';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { ContextMenuOverlayService } from './context-menu-overlay.service';
|
||||
import { Injector } from '@angular/core';
|
||||
import { setupTestBed } from '../testing/setupTestBed';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
describe('ContextMenuService', () => {
|
||||
let contextMenuOverlayService: ContextMenuOverlayService;
|
||||
@@ -34,12 +35,12 @@ describe('ContextMenuService', () => {
|
||||
}
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule, CoreTestingModule],
|
||||
providers: [ Overlay ]
|
||||
});
|
||||
setupTestBed({
|
||||
imports: [NoopAnimationsModule, CoreTestingModule],
|
||||
providers: [ Overlay ]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
overlay = TestBed.get(Overlay);
|
||||
injector = TestBed.get(Injector);
|
||||
});
|
||||
|
@@ -20,6 +20,7 @@ import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { ContextMenuModule } from './context-menu.module';
|
||||
import { CoreModule } from '../core.module';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { setupTestBed } from '../testing/setupTestBed';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-test-component',
|
||||
@@ -78,18 +79,18 @@ describe('ContextMenuDirective', () => {
|
||||
}
|
||||
];
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
ContextMenuModule,
|
||||
NoopAnimationsModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
]
|
||||
});
|
||||
setupTestBed({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
ContextMenuModule,
|
||||
NoopAnimationsModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
fixture.componentInstance.actions = actions;
|
||||
fixture.detectChanges();
|
||||
|
Reference in New Issue
Block a user