mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 04:05:40 +01:00
Add unit test for hidden columns (#18873)
1. Fixes #18870 Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
d84b1d07d2
commit
8fe561865d
@ -159,4 +159,12 @@ describe('ListReplicationRuleComponent (inline template)', () => {
|
|||||||
fixture.nativeElement.querySelector('.modal-body');
|
fixture.nativeElement.querySelector('.modal-body');
|
||||||
expect(body).toBeFalsy();
|
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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -353,6 +353,13 @@ describe('ArtifactListTabComponent (inline template)', () => {
|
|||||||
fixture.nativeElement.querySelector('.confirmation-title')
|
fixture.nativeElement.querySelector('.confirmation-title')
|
||||||
).toBeTruthy();
|
).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) {
|
async function stepOpenAction(fixture, comp) {
|
||||||
|
@ -162,19 +162,7 @@ export class ArtifactListTabComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
hiddenArray: boolean[] = getHiddenArrayFromLocalStorage(
|
hiddenArray: boolean[] = getHiddenArrayFromLocalStorage(
|
||||||
PageSizeMapKeys.ARTIFACT_LIST_TAB_COMPONENT,
|
PageSizeMapKeys.ARTIFACT_LIST_TAB_COMPONENT,
|
||||||
[
|
[false, false, false, false, false, false, true, false, false, false]
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
]
|
|
||||||
);
|
);
|
||||||
deleteAccessorySub: Subscription;
|
deleteAccessorySub: Subscription;
|
||||||
copyDigestSub: Subscription;
|
copyDigestSub: Subscription;
|
||||||
|
Loading…
Reference in New Issue
Block a user