Fixed after rebase

This commit is contained in:
VitoAlbano 2024-05-23 13:32:19 +01:00
parent 5f497ea8bd
commit ee8b240cff
4 changed files with 16 additions and 8 deletions

View File

@ -1,8 +1,10 @@
<div id="site-dropdown-container" class="adf-site-dropdown-container">
<mat-form-field class="adf-sites-dropdown-form-field" appearance="fill" subscriptSizing="dynamic">
<mat-label>{{placeholder | translate}}</mat-label>
<mat-select
adf-infinite-select-scroll
(scrollEnd)="loadAllOnScroll()"
#siteSelect
data-automation-id="site-my-files-option"
class="adf-site-dropdown-list-element"
id="site-dropdown"

View File

@ -32,6 +32,7 @@ import { HarnessLoader } from '@angular/cdk/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { MatSelectHarness } from '@angular/material/select/testing';
import { SiteEntry } from '@alfresco/js-api';
import { MatFormFieldHarness } from '@angular/material/form-field/testing';
const customSiteList = {
list: {
@ -66,6 +67,10 @@ describe('DropdownSitesComponent', () => {
});
});
afterEach(() => {
fixture.destroy();
});
describe('Rendering tests', () => {
describe('Infinite Loading', () => {
beforeEach(() => {
@ -144,10 +149,10 @@ describe('DropdownSitesComponent', () => {
fixture.detectChanges();
await fixture.whenStable();
const select = await loader.getHarness(MatSelectHarness);
await select.open();
const selectFormField = await loader.getHarness(MatFormFieldHarness);
const label = await selectFormField.getLabel();
expect(fixture.nativeElement.innerText.trim()).toContain('NODE_SELECTOR.LOCATION');
expect(label).toContain('DROPDOWN.PLACEHOLDER_LABEL');
});
it('should show custom placeholder label when the "placeholder" input property is given a value', async () => {
@ -156,10 +161,10 @@ describe('DropdownSitesComponent', () => {
fixture.detectChanges();
await fixture.whenStable();
const select = await loader.getHarness(MatSelectHarness);
await select.open();
const selectFormField = await loader.getHarness(MatFormFieldHarness);
const label = await selectFormField.getLabel();
expect(fixture.nativeElement.innerText.trim()).toContain('NODE_SELECTOR.LOCATION');
expect(label).toContain('NODE_SELECTOR.SELECT_LIBRARY');
});
it('should load custom sites when the "siteList" input property is given a value', async () => {

View File

@ -1431,7 +1431,7 @@ describe('DocumentList', () => {
expect(documentList.reload).toHaveBeenCalled();
});
it('should not show loading state if pagination is updated with merge setting as true', fakeAsync(() => {
it('should not show loading state if pagination is updated with merge setting as true', () => {
spyFolderNode = spyOn(documentListService, 'loadFolderByNodeId').and.callFake(() =>
of(
new DocumentLoaderNode(null, {
@ -1456,7 +1456,7 @@ describe('DocumentList', () => {
fixture.detectChanges();
expect(element.querySelector('#adf-document-list-loading')).toBe(null);
}));
});
it('should NOT reload data on first call of ngOnChanges', () => {
spyOn(documentList, 'reload').and.stub();

View File

@ -26,6 +26,7 @@ import { MatIconModule } from '@angular/material/icon';
import { NgForOf, NgIf } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { DOWN_ARROW, UP_ARROW } from '@angular/cdk/keycodes';
import { MatTooltipModule } from '@angular/material/tooltip';
@Component({
selector: 'adf-context-menu',