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:
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MaterialModule } from '../../../material.module';
|
||||
import { SidebarActionMenuComponent } from './sidebar-action-menu.component';
|
||||
import { setupTestBed } from '../../../testing/setupTestBed';
|
||||
@@ -57,23 +57,23 @@ describe('SidebarActionMenuComponent', () => {
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<adf-sidebar-action-menu [expanded]="expanded" [title]="title">
|
||||
<mat-icon adf-sidebar-menu-title-icon>arrow_drop_down</mat-icon>
|
||||
<div adf-sidebar-menu-expand-icon>
|
||||
<mat-icon>queue</mat-icon>
|
||||
</div>
|
||||
<div adf-sidebar-menu-options>
|
||||
<button mat-menu-item>
|
||||
<mat-icon>assignment</mat-icon>
|
||||
<span>Option1</span>
|
||||
</button>
|
||||
<button mat-menu-item>
|
||||
<mat-icon>assignment</mat-icon>
|
||||
<span>Option2</span>
|
||||
</button>
|
||||
</div>
|
||||
</adf-sidebar-action-menu>
|
||||
`
|
||||
<adf-sidebar-action-menu [expanded]="expanded" [title]="title">
|
||||
<mat-icon adf-sidebar-menu-title-icon>arrow_drop_down</mat-icon>
|
||||
<div adf-sidebar-menu-expand-icon>
|
||||
<mat-icon>queue</mat-icon>
|
||||
</div>
|
||||
<div adf-sidebar-menu-options>
|
||||
<button mat-menu-item>
|
||||
<mat-icon>assignment</mat-icon>
|
||||
<span>Option1</span>
|
||||
</button>
|
||||
<button mat-menu-item>
|
||||
<mat-icon>assignment</mat-icon>
|
||||
<span>Option2</span>
|
||||
</button>
|
||||
</div>
|
||||
</adf-sidebar-action-menu>
|
||||
`
|
||||
})
|
||||
class CustomSidebarActionMenuComponent {
|
||||
title: string = 'Fake title';
|
||||
@@ -85,17 +85,15 @@ describe('Custom SidebarActionMenuComponent', () => {
|
||||
let component: CustomSidebarActionMenuComponent;
|
||||
let element: HTMLElement;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [
|
||||
SidebarActionMenuComponent,
|
||||
CustomSidebarActionMenuComponent
|
||||
],
|
||||
imports: [
|
||||
MaterialModule
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
setupTestBed({
|
||||
declarations: [
|
||||
SidebarActionMenuComponent,
|
||||
CustomSidebarActionMenuComponent
|
||||
],
|
||||
imports: [
|
||||
MaterialModule
|
||||
]
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(CustomSidebarActionMenuComponent);
|
||||
|
Reference in New Issue
Block a user