skipped_tests_fix

Signed-off-by: Yogi_Wang <yawang@vmware.com>
This commit is contained in:
Yogi_Wang 2019-02-15 14:34:07 +08:00
parent d28b8355ef
commit 4ee5ebe442
2 changed files with 20 additions and 4 deletions

View File

@ -7,13 +7,27 @@ import { SharedModule } from "../../shared/shared.module";
import { ErrorHandler } from '../../error-handler/error-handler';
import { GcViewModelFactory } from './gc.viewmodel.factory';
import { GcUtility } from './gc.utility';
import { of } from 'rxjs';
describe('GcComponent', () => {
let component: GcComponent;
let fixture: ComponentFixture<GcComponent>;
let gcRepoService: GcRepoService;
let config: IServiceConfig = {
systemInfoEndpoint: "/api/system/gc"
};
let mockSchedule = [];
let mockJobs = [
{
id: 22222,
schedule: null,
job_status: 'string',
creation_time: new Date(),
update_time: new Date(),
}
];
let spySchedule: jasmine.Spy;
let spyJobs: jasmine.Spy;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
@ -35,9 +49,12 @@ describe('GcComponent', () => {
beforeEach(() => {
fixture = TestBed.createComponent(GcComponent);
component = fixture.componentInstance;
gcRepoService = fixture.debugElement.injector.get(GcRepoService);
spySchedule = spyOn(gcRepoService, "getSchedule").and.returnValues(of(mockSchedule));
spyJobs = spyOn(gcRepoService, "getJobs").and.returnValues(of(mockJobs));
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});

View File

@ -175,8 +175,7 @@ describe("TagComponent (inline template)", () => {
expect(spy.calls.any).toBeTruthy();
}));
// fail after upgrade to angular 6.
xit("should load and render data", async(() => {
it("should load and render data", () => {
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
@ -187,7 +186,7 @@ describe("TagComponent (inline template)", () => {
expect(el).toBeTruthy();
expect(el.textContent.trim()).toEqual("1.11.5");
});
}));
});
});