diff --git a/src/portal/src/app/base/left-side-nav/replication/replication/list-replication-rule/list-replication-rule.component.spec.ts b/src/portal/src/app/base/left-side-nav/replication/replication/list-replication-rule/list-replication-rule.component.spec.ts index 43b6edda1..4c2f3fb57 100644 --- a/src/portal/src/app/base/left-side-nav/replication/replication/list-replication-rule/list-replication-rule.component.spec.ts +++ b/src/portal/src/app/base/left-side-nav/replication/replication/list-replication-rule/list-replication-rule.component.spec.ts @@ -159,4 +159,12 @@ describe('ListReplicationRuleComponent (inline template)', () => { fixture.nativeElement.querySelector('.modal-body'); expect(body).toBeFalsy(); }); + + it('the length of hide array should equal to the number of column', async () => { + comp.loading = false; + fixture.detectChanges(); + await fixture.whenStable(); + const cols = fixture.nativeElement.querySelectorAll('clr-dg-column'); + expect(cols.length).toEqual(comp.hiddenArray.length); + }); }); diff --git a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.spec.ts b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.spec.ts index bd67bf39f..b9fb2f5cd 100644 --- a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.spec.ts +++ b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.spec.ts @@ -353,6 +353,13 @@ describe('ArtifactListTabComponent (inline template)', () => { fixture.nativeElement.querySelector('.confirmation-title') ).toBeTruthy(); }); + it('the length of hide array should equal to the number of column', async () => { + comp.loading = false; + fixture.detectChanges(); + await fixture.whenStable(); + const cols = fixture.nativeElement.querySelectorAll('.datagrid-column'); + expect(cols.length).toEqual(comp.hiddenArray.length); + }); }); async function stepOpenAction(fixture, comp) { diff --git a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts index 72e0459f1..2ffa0291f 100644 --- a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts +++ b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.ts @@ -162,19 +162,7 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy { hiddenArray: boolean[] = getHiddenArrayFromLocalStorage( PageSizeMapKeys.ARTIFACT_LIST_TAB_COMPONENT, - [ - false, - false, - false, - false, - false, - false, - false, - true, - false, - false, - false, - ] + [false, false, false, false, false, false, true, false, false, false] ); deleteAccessorySub: Subscription; copyDigestSub: Subscription;