Merge pull request #12814 from AllForNothing/ui-ut

Improve UI UT for artifact list page
This commit is contained in:
Will Sun 2020-08-19 15:08:19 +08:00 committed by GitHub
commit c35a39d432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -267,6 +267,11 @@ describe("ArtifactListTabComponent (inline template)", () => {
}
};
const mockNewArtifactService = {
TriggerArtifactChan$: {
subscribe: (fn) => {
}
},
listArtifactsResponse: () => {
if (filtereName === 'sha256:3e33e3e3') {
return of(
@ -314,7 +319,7 @@ describe("ArtifactListTabComponent (inline template)", () => {
ArtifactDefaultService,
{ provide: Router, useValue: mockRouter },
{ provide: SERVICE_CONFIG, useValue: config },
{ provide: ArtifactService, useValue: mockArtifactService },
{ provide: ArtifactService, useValue: mockNewArtifactService },
{ provide: ProjectService, useClass: ProjectDefaultService },
{ provide: ScanningResultService, useClass: ScanningResultDefaultService },
{ provide: LabelService, useClass: LabelDefaultService },