2020-09-22 11:42:01 +02:00
|
|
|
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
|
|
|
|
import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
|
2020-02-13 08:39:29 +01:00
|
|
|
import { ArtifactListTabComponent } from "./artifact-list-tab.component";
|
2019-10-10 11:42:45 +02:00
|
|
|
import { of } from "rxjs";
|
2019-03-12 11:03:47 +01:00
|
|
|
import { delay } from "rxjs/operators";
|
2020-12-09 04:33:55 +01:00
|
|
|
import { HttpClient, HttpHeaders, HttpResponse } from "@angular/common/http";
|
2020-02-20 09:12:46 +01:00
|
|
|
import { ActivatedRoute, Router } from "@angular/router";
|
2021-02-18 02:12:23 +01:00
|
|
|
import { ArtifactDefaultService, ArtifactService } from "../../../artifact.service";
|
2020-02-20 09:12:46 +01:00
|
|
|
import {
|
|
|
|
Label,
|
|
|
|
ProjectDefaultService,
|
|
|
|
ProjectService,
|
|
|
|
ScanningResultDefaultService,
|
|
|
|
ScanningResultService,
|
|
|
|
UserPermissionDefaultService,
|
|
|
|
UserPermissionService,
|
|
|
|
USERSTATICPERMISSION
|
2021-02-18 02:12:23 +01:00
|
|
|
} from "../../../../../../../shared/services";
|
|
|
|
import { ArtifactFront as Artifact } from "../../../artifact";
|
|
|
|
import { LabelPieceComponent } from "../../../../../../../shared/components/label/label-piece/label-piece.component";
|
|
|
|
import { ConfirmationDialogComponent } from "../../../../../../../shared/components/confirmation-dialog";
|
|
|
|
import { ImageNameInputComponent } from "../../../../../../../shared/components/image-name-input/image-name-input.component";
|
|
|
|
import { CopyInputComponent } from "../../../../../../../shared/components/push-image/copy-input.component";
|
|
|
|
import { ErrorHandler } from "../../../../../../../shared/units/error-handler";
|
|
|
|
import { OperationService } from "../../../../../../../shared/components/operation/operation.service";
|
|
|
|
import { ArtifactService as NewArtifactService } from "../../../../../../../../../ng-swagger-gen/services/artifact.service";
|
|
|
|
import { Tag } from "../../../../../../../../../ng-swagger-gen/models/tag";
|
|
|
|
import { SharedTestingModule } from "../../../../../../../shared/shared.module";
|
2021-04-26 04:32:38 +02:00
|
|
|
import { LabelService } from "../../../../../../../../../ng-swagger-gen/services/label.service";
|
|
|
|
import { Registry } from "../../../../../../../../../ng-swagger-gen/models/registry";
|
2018-10-11 17:48:56 +02:00
|
|
|
|
2020-02-13 08:39:29 +01:00
|
|
|
describe("ArtifactListTabComponent (inline template)", () => {
|
2017-05-15 12:40:13 +02:00
|
|
|
|
2020-02-13 08:39:29 +01:00
|
|
|
let comp: ArtifactListTabComponent;
|
|
|
|
let fixture: ComponentFixture<ArtifactListTabComponent>;
|
2019-01-09 09:08:56 +01:00
|
|
|
let userPermissionService: UserPermissionService;
|
2018-03-23 02:58:06 +01:00
|
|
|
let spyLabels: jasmine.Spy;
|
|
|
|
let spyLabels1: jasmine.Spy;
|
2019-10-10 11:42:45 +02:00
|
|
|
let spyScanner: jasmine.Spy;
|
|
|
|
let scannerMock = {
|
|
|
|
disabled: false,
|
2020-11-26 10:13:37 +01:00
|
|
|
name: "Trivy"
|
2019-10-10 11:42:45 +02:00
|
|
|
};
|
2020-02-13 08:39:29 +01:00
|
|
|
let mockActivatedRoute = {
|
2020-02-20 09:12:46 +01:00
|
|
|
snapshot: {
|
|
|
|
params: {
|
|
|
|
id: 1,
|
|
|
|
repo: "test",
|
|
|
|
digest: "ABC",
|
|
|
|
subscribe: () => {
|
|
|
|
return of(null);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data: {
|
|
|
|
projectResolver: {
|
|
|
|
has_project_admin_role: true,
|
|
|
|
current_user_role_id: 3,
|
|
|
|
name: "demo"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2020-02-13 08:39:29 +01:00
|
|
|
data: of(
|
|
|
|
{
|
|
|
|
projectResolver: {
|
|
|
|
name: 'library'
|
|
|
|
}
|
|
|
|
}
|
2020-02-20 09:12:46 +01:00
|
|
|
),
|
|
|
|
params: {
|
|
|
|
subscribe: () => {
|
|
|
|
return of(null);
|
|
|
|
}
|
|
|
|
}
|
2020-02-13 08:39:29 +01:00
|
|
|
};
|
|
|
|
let mockArtifacts: Artifact[] = [
|
2017-05-25 13:14:35 +02:00
|
|
|
{
|
2020-02-13 08:39:29 +01:00
|
|
|
"id": 1,
|
|
|
|
type: 'image',
|
|
|
|
tags: [{
|
2020-02-25 03:36:24 +01:00
|
|
|
id: 1,
|
2020-02-13 08:39:29 +01:00
|
|
|
name: 'tag1',
|
2020-02-25 03:36:24 +01:00
|
|
|
artifact_id: 1
|
2020-02-24 02:59:06 +01:00
|
|
|
},
|
|
|
|
{
|
2020-02-25 03:36:24 +01:00
|
|
|
id: 2,
|
2020-02-24 02:59:06 +01:00
|
|
|
name: 'tag2',
|
|
|
|
artifact_id: 2,
|
|
|
|
pull_time: '2020-01-06T09:40:08.036866579Z',
|
|
|
|
push_time: '2020-01-06T09:40:08.036866579Z',
|
2020-02-25 03:36:24 +01:00
|
|
|
}],
|
|
|
|
references: [],
|
2020-02-24 02:59:06 +01:00
|
|
|
media_type: 'string',
|
|
|
|
"digest": "sha256:4875cda368906fd670c9629b5e416ab3d6c0292015f3c3f12ef37dc9a32fc8d4",
|
|
|
|
"size": 20372934,
|
|
|
|
"scan_overview": {
|
|
|
|
"application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0": {
|
|
|
|
"report_id": "5e64bc05-3102-11ea-93ae-0242ac140004",
|
|
|
|
"scan_status": "Error",
|
|
|
|
"severity": "",
|
|
|
|
"duration": 118,
|
|
|
|
"summary": null,
|
|
|
|
"start_time": "2020-01-07T04:01:23.157711Z",
|
|
|
|
"end_time": "2020-01-07T04:03:21.662766Z"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"labels": [
|
|
|
|
{
|
|
|
|
"id": 3,
|
|
|
|
"name": "aaa",
|
|
|
|
"description": "",
|
|
|
|
"color": "#0095D3",
|
|
|
|
"scope": "g",
|
|
|
|
"project_id": 0,
|
|
|
|
"creation_time": "2020-01-13T05:44:00.580198Z",
|
2020-03-05 07:26:53 +01:00
|
|
|
"update_time": "2020-01-13T05:44:00.580198Z"
|
2020-02-24 02:59:06 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 6,
|
|
|
|
"name": "dbc",
|
|
|
|
"description": "",
|
|
|
|
"color": "",
|
|
|
|
"scope": "g",
|
|
|
|
"project_id": 0,
|
|
|
|
"creation_time": "2020-01-13T08:27:19.279123Z",
|
2020-03-05 07:26:53 +01:00
|
|
|
"update_time": "2020-01-13T08:27:19.279123Z"
|
2020-02-24 02:59:06 +01:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"push_time": "2020-01-07T03:33:41.162319Z",
|
|
|
|
"pull_time": "0001-01-01T00:00:00Z"
|
2020-02-13 08:39:29 +01:00
|
|
|
},
|
|
|
|
{
|
2020-02-24 02:59:06 +01:00
|
|
|
"id": 1,
|
|
|
|
type: 'image',
|
|
|
|
tags: [{
|
2020-02-25 03:36:24 +01:00
|
|
|
id: 1,
|
2020-02-24 02:59:06 +01:00
|
|
|
name: 'tag1',
|
2020-02-25 03:36:24 +01:00
|
|
|
artifact_id: 1
|
2020-02-24 02:59:06 +01:00
|
|
|
},
|
|
|
|
{
|
2020-02-25 03:36:24 +01:00
|
|
|
id: 2,
|
2020-02-13 08:39:29 +01:00
|
|
|
name: 'tag2',
|
|
|
|
artifact_id: 2,
|
|
|
|
pull_time: '2020-01-06T09:40:08.036866579Z',
|
|
|
|
push_time: '2020-01-06T09:40:08.036866579Z',
|
2020-02-20 09:12:46 +01:00
|
|
|
}
|
|
|
|
],
|
2020-02-25 03:36:24 +01:00
|
|
|
references: [],
|
2020-02-13 08:39:29 +01:00
|
|
|
media_type: 'string',
|
2020-02-24 02:59:06 +01:00
|
|
|
"digest": "sha256:3e33e3e3",
|
2020-02-13 08:39:29 +01:00
|
|
|
"size": 20372934,
|
|
|
|
"scan_overview": {
|
|
|
|
"application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0": {
|
|
|
|
"report_id": "5e64bc05-3102-11ea-93ae-0242ac140004",
|
|
|
|
"scan_status": "Error",
|
|
|
|
"severity": "",
|
|
|
|
"duration": 118,
|
|
|
|
"summary": null,
|
|
|
|
"start_time": "2020-01-07T04:01:23.157711Z",
|
|
|
|
"end_time": "2020-01-07T04:03:21.662766Z"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"labels": [
|
|
|
|
{
|
|
|
|
"id": 3,
|
|
|
|
"name": "aaa",
|
|
|
|
"description": "",
|
|
|
|
"color": "#0095D3",
|
|
|
|
"scope": "g",
|
|
|
|
"project_id": 0,
|
|
|
|
"creation_time": "2020-01-13T05:44:00.580198Z",
|
2020-03-05 07:26:53 +01:00
|
|
|
"update_time": "2020-01-13T05:44:00.580198Z"
|
2020-02-13 08:39:29 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 6,
|
|
|
|
"name": "dbc",
|
|
|
|
"description": "",
|
|
|
|
"color": "",
|
|
|
|
"scope": "g",
|
|
|
|
"project_id": 0,
|
|
|
|
"creation_time": "2020-01-13T08:27:19.279123Z",
|
2020-03-05 07:26:53 +01:00
|
|
|
"update_time": "2020-01-13T08:27:19.279123Z"
|
2020-02-13 08:39:29 +01:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"push_time": "2020-01-07T03:33:41.162319Z",
|
|
|
|
"pull_time": "0001-01-01T00:00:00Z",
|
2020-02-24 02:59:06 +01:00
|
|
|
}
|
2018-03-23 02:58:06 +01:00
|
|
|
];
|
2020-02-24 02:59:06 +01:00
|
|
|
let filtereName = '';
|
2018-03-23 02:58:06 +01:00
|
|
|
let mockLabels: Label[] = [
|
|
|
|
{
|
|
|
|
color: "#9b0d54",
|
|
|
|
creation_time: "",
|
|
|
|
description: "",
|
|
|
|
id: 1,
|
|
|
|
name: "label0-g",
|
|
|
|
project_id: 0,
|
|
|
|
scope: "g",
|
|
|
|
update_time: "",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
color: "#9b0d54",
|
|
|
|
creation_time: "",
|
|
|
|
description: "",
|
|
|
|
id: 2,
|
|
|
|
name: "label1-g",
|
|
|
|
project_id: 0,
|
|
|
|
scope: "g",
|
|
|
|
update_time: "",
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
let mockLabels1: Label[] = [
|
|
|
|
{
|
|
|
|
color: "#9b0d54",
|
|
|
|
creation_time: "",
|
|
|
|
description: "",
|
|
|
|
id: 1,
|
|
|
|
name: "label0-g",
|
|
|
|
project_id: 1,
|
|
|
|
scope: "p",
|
|
|
|
update_time: "",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
color: "#9b0d54",
|
|
|
|
creation_time: "",
|
|
|
|
description: "",
|
|
|
|
id: 2,
|
|
|
|
name: "label1-g",
|
|
|
|
project_id: 1,
|
|
|
|
scope: "p",
|
|
|
|
update_time: "",
|
2017-05-25 13:14:35 +02:00
|
|
|
}
|
|
|
|
];
|
2019-01-09 09:08:56 +01:00
|
|
|
let mockHasAddLabelImagePermission: boolean = true;
|
|
|
|
let mockHasRetagImagePermission: boolean = true;
|
|
|
|
let mockHasDeleteImagePermission: boolean = true;
|
|
|
|
let mockHasScanImagePermission: boolean = true;
|
2019-10-22 10:04:11 +02:00
|
|
|
const mockErrorHandler = {
|
2020-02-24 02:59:06 +01:00
|
|
|
error: () => { }
|
2019-10-22 10:04:11 +02:00
|
|
|
};
|
|
|
|
const permissions = [
|
2020-03-31 08:23:49 +02:00
|
|
|
{ resource: USERSTATICPERMISSION.REPOSITORY_ARTIFACT_LABEL.KEY, action: USERSTATICPERMISSION.REPOSITORY_ARTIFACT_LABEL.VALUE.CREATE },
|
2020-02-24 02:59:06 +01:00
|
|
|
{ resource: USERSTATICPERMISSION.REPOSITORY.KEY, action: USERSTATICPERMISSION.REPOSITORY.VALUE.PULL },
|
2020-03-31 08:23:49 +02:00
|
|
|
{ resource: USERSTATICPERMISSION.ARTIFACT.KEY, action: USERSTATICPERMISSION.ARTIFACT.VALUE.DELETE },
|
2020-02-24 02:59:06 +01:00
|
|
|
{ resource: USERSTATICPERMISSION.REPOSITORY_TAG_SCAN_JOB.KEY, action: USERSTATICPERMISSION.REPOSITORY_TAG_SCAN_JOB.VALUE.CREATE },
|
2019-10-22 10:04:11 +02:00
|
|
|
];
|
2020-02-20 09:12:46 +01:00
|
|
|
const mockRouter = {
|
|
|
|
navigate: () => { }
|
|
|
|
};
|
2020-02-24 02:59:06 +01:00
|
|
|
const mockOperationService = {
|
|
|
|
publishInfo: () => {}
|
|
|
|
};
|
2020-12-09 04:33:55 +01:00
|
|
|
const mockTag: Tag = {
|
|
|
|
id: 1,
|
|
|
|
name: "latest"
|
2020-02-25 09:07:21 +01:00
|
|
|
};
|
|
|
|
const mockNewArtifactService = {
|
2020-08-19 06:45:39 +02:00
|
|
|
TriggerArtifactChan$: {
|
|
|
|
subscribe: (fn) => {
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
2020-02-25 09:07:21 +01:00
|
|
|
listArtifactsResponse: () => {
|
2020-02-24 02:59:06 +01:00
|
|
|
if (filtereName === 'sha256:3e33e3e3') {
|
|
|
|
return of(
|
|
|
|
{
|
|
|
|
body: [mockArtifacts[1]]
|
|
|
|
}
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return of(
|
|
|
|
{
|
|
|
|
body: mockArtifacts
|
|
|
|
}
|
|
|
|
).pipe(delay(0));
|
|
|
|
}
|
|
|
|
},
|
2020-08-11 04:22:02 +02:00
|
|
|
deleteArtifact: () => of (null),
|
|
|
|
getIconsFromBackEnd() {
|
|
|
|
return undefined;
|
|
|
|
},
|
|
|
|
getIcon() {
|
|
|
|
return undefined;
|
2020-12-09 04:33:55 +01:00
|
|
|
},
|
|
|
|
listTagsResponse: () => {
|
|
|
|
const res: HttpResponse<Array<Tag>> = new HttpResponse<Array<Tag>>({
|
|
|
|
headers: new HttpHeaders({'x-total-count': '1'}),
|
|
|
|
body: [mockTag]
|
|
|
|
});
|
|
|
|
return of(res).pipe(delay(0));
|
2020-08-11 04:22:02 +02:00
|
|
|
}
|
2020-02-25 09:07:21 +01:00
|
|
|
};
|
2020-09-22 11:42:01 +02:00
|
|
|
beforeEach(waitForAsync(() => {
|
2017-05-15 12:40:13 +02:00
|
|
|
TestBed.configureTestingModule({
|
|
|
|
imports: [
|
2021-02-18 02:12:23 +01:00
|
|
|
SharedTestingModule,
|
2019-10-10 11:42:45 +02:00
|
|
|
],
|
|
|
|
schemas: [
|
|
|
|
CUSTOM_ELEMENTS_SCHEMA
|
2017-05-15 12:40:13 +02:00
|
|
|
],
|
|
|
|
declarations: [
|
2020-02-13 08:39:29 +01:00
|
|
|
ArtifactListTabComponent,
|
2018-03-23 02:58:06 +01:00
|
|
|
LabelPieceComponent,
|
2017-06-19 18:51:08 +02:00
|
|
|
ConfirmationDialogComponent,
|
2018-10-11 17:48:56 +02:00
|
|
|
ImageNameInputComponent,
|
|
|
|
CopyInputComponent
|
2017-05-15 12:40:13 +02:00
|
|
|
],
|
|
|
|
providers: [
|
2020-02-20 09:12:46 +01:00
|
|
|
ArtifactDefaultService,
|
|
|
|
{ provide: Router, useValue: mockRouter },
|
2020-08-19 06:45:39 +02:00
|
|
|
{ provide: ArtifactService, useValue: mockNewArtifactService },
|
2018-10-11 17:48:56 +02:00
|
|
|
{ provide: ProjectService, useClass: ProjectDefaultService },
|
2018-03-23 02:58:06 +01:00
|
|
|
{ provide: ScanningResultService, useClass: ScanningResultDefaultService },
|
2019-01-09 09:08:56 +01:00
|
|
|
{ provide: UserPermissionService, useClass: UserPermissionDefaultService },
|
2020-02-13 08:39:29 +01:00
|
|
|
{ provide: ErrorHandler, useValue: mockErrorHandler },
|
|
|
|
{ provide: ActivatedRoute, useValue: mockActivatedRoute },
|
2020-02-24 02:59:06 +01:00
|
|
|
{ provide: OperationService, useValue: mockOperationService },
|
2020-02-25 09:07:21 +01:00
|
|
|
{ provide: NewArtifactService, useValue: mockNewArtifactService },
|
2017-05-15 12:40:13 +02:00
|
|
|
]
|
2019-10-10 11:42:45 +02:00
|
|
|
}).compileComponents();
|
2017-05-15 12:40:13 +02:00
|
|
|
}));
|
|
|
|
|
2017-06-19 18:51:08 +02:00
|
|
|
beforeEach(() => {
|
2020-02-13 08:39:29 +01:00
|
|
|
fixture = TestBed.createComponent(ArtifactListTabComponent);
|
2017-05-15 12:40:13 +02:00
|
|
|
comp = fixture.componentInstance;
|
|
|
|
comp.projectId = 1;
|
2018-10-11 17:48:56 +02:00
|
|
|
comp.repoName = "library/nginx";
|
2019-01-09 09:08:56 +01:00
|
|
|
comp.hasDeleteImagePermission = true;
|
|
|
|
comp.hasScanImagePermission = true;
|
2017-06-07 12:47:18 +02:00
|
|
|
comp.hasSignedIn = true;
|
2018-10-11 17:48:56 +02:00
|
|
|
comp.registryUrl = "http://registry.testing.com";
|
2017-06-13 10:09:46 +02:00
|
|
|
comp.withNotary = false;
|
2019-01-09 09:08:56 +01:00
|
|
|
comp.withAdmiral = false;
|
2018-03-23 02:58:06 +01:00
|
|
|
let labelService: LabelService;
|
2019-01-09 09:08:56 +01:00
|
|
|
userPermissionService = fixture.debugElement.injector.get(UserPermissionService);
|
2019-10-10 11:42:45 +02:00
|
|
|
let http: HttpClient;
|
|
|
|
http = fixture.debugElement.injector.get(HttpClient);
|
|
|
|
spyScanner = spyOn(http, "get").and.returnValue(of(scannerMock));
|
2019-10-22 10:04:11 +02:00
|
|
|
spyOn(userPermissionService, "hasProjectPermissions")
|
2020-02-24 02:59:06 +01:00
|
|
|
.withArgs(comp.projectId, permissions)
|
|
|
|
.and.returnValue(of([mockHasAddLabelImagePermission, mockHasRetagImagePermission,
|
|
|
|
mockHasDeleteImagePermission, mockHasScanImagePermission]));
|
|
|
|
|
2018-03-23 02:58:06 +01:00
|
|
|
labelService = fixture.debugElement.injector.get(LabelService);
|
2021-04-26 04:32:38 +02:00
|
|
|
const response: HttpResponse<Array<Registry>> = new HttpResponse<Array<Registry>>({
|
|
|
|
headers: new HttpHeaders({'x-total-count': [].length.toString()}),
|
|
|
|
body: mockLabels
|
|
|
|
});
|
|
|
|
spyLabels = spyOn(labelService, "ListLabelsResponse").and.returnValues(
|
|
|
|
of(response).pipe(delay(0))
|
|
|
|
);
|
2021-06-16 10:39:10 +02:00
|
|
|
spyLabels1 = spyOn(labelService, "ListLabels").withArgs({projectId: comp.projectId}).and.returnValues(of(mockLabels1).pipe(delay(0)));
|
2017-05-15 12:40:13 +02:00
|
|
|
fixture.detectChanges();
|
|
|
|
});
|
2020-02-24 02:59:06 +01:00
|
|
|
|
2020-09-22 11:42:01 +02:00
|
|
|
it("should load and render data", async () => {
|
2020-02-24 02:59:06 +01:00
|
|
|
fixture.detectChanges();
|
2020-09-22 11:42:01 +02:00
|
|
|
await fixture.whenStable();
|
|
|
|
comp.artifactList = mockArtifacts;
|
|
|
|
fixture.detectChanges();
|
|
|
|
await fixture.whenStable();
|
|
|
|
const el: HTMLAnchorElement = fixture.nativeElement.querySelector('a.max-width-100');
|
|
|
|
expect(el).toBeTruthy();
|
|
|
|
expect(el.textContent).toBeTruthy();
|
|
|
|
expect(el.textContent.trim()).toEqual("sha256:4875cda3");
|
2020-02-24 02:59:06 +01:00
|
|
|
});
|
|
|
|
it('should filter data by keyword', async () => {
|
|
|
|
fixture.detectChanges();
|
|
|
|
await fixture.whenStable();
|
|
|
|
filtereName = 'sha256:3e33e3e3';
|
2020-03-10 05:07:56 +01:00
|
|
|
comp.doSearchArtifactByFilter('sha256:3e33e3e3');
|
2020-02-24 02:59:06 +01:00
|
|
|
fixture.detectChanges();
|
|
|
|
await fixture.whenStable();
|
|
|
|
fixture.detectChanges();
|
2020-09-22 11:42:01 +02:00
|
|
|
const el: HTMLAnchorElement = fixture.nativeElement.querySelector('a.max-width-100');
|
2020-02-24 02:59:06 +01:00
|
|
|
expect(el).toBeTruthy();
|
2020-09-22 11:42:01 +02:00
|
|
|
expect(el.textContent).toBeTruthy();
|
2020-02-24 02:59:06 +01:00
|
|
|
expect(el.textContent.trim()).toEqual('sha256:3e33e3e3');
|
|
|
|
});
|
|
|
|
it('should delete artifact', async () => {
|
|
|
|
fixture.detectChanges();
|
|
|
|
await fixture.whenStable();
|
|
|
|
comp.selectedRow = [mockArtifacts[0]];
|
|
|
|
filtereName = 'sha256:3e33e3e3';
|
|
|
|
comp.confirmDeletion({source: 9, state: 1, data: comp.selectedRow});
|
|
|
|
fixture.detectChanges();
|
|
|
|
await fixture.whenStable();
|
|
|
|
fixture.detectChanges();
|
2020-09-22 11:42:01 +02:00
|
|
|
const el: HTMLAnchorElement = fixture.nativeElement.querySelector('a.max-width-100');
|
2020-02-24 02:59:06 +01:00
|
|
|
expect(el).toBeTruthy();
|
2020-09-22 11:42:01 +02:00
|
|
|
expect(el.textContent).toBeTruthy();
|
2020-02-24 02:59:06 +01:00
|
|
|
expect(el.textContent.trim()).toEqual('sha256:3e33e3e3');
|
|
|
|
});
|
2018-05-14 14:01:00 +02:00
|
|
|
});
|
2019-01-09 09:08:56 +01:00
|
|
|
|
|
|
|
|