mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 20:26:13 +01:00
skipped_tests_fix
Signed-off-by: Yogi_Wang <yawang@vmware.com>
This commit is contained in:
parent
d28b8355ef
commit
4ee5ebe442
@ -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();
|
||||
});
|
||||
|
@ -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");
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user