[affected:*][ci:force] Fixing rebase

This commit is contained in:
Vito Albano
2024-03-07 17:12:22 +00:00
committed by VitoAlbano
parent 9ed7c59ab0
commit a4ed406859
4 changed files with 53 additions and 55 deletions

View File

@@ -57,13 +57,21 @@
</mat-expansion-panel>
<ng-container *ngIf="displayTags">
<mat-expansion-panel hideToggle [(expanded)]="isTagPanelExpanded" class="adf-content-metadata-panel">
<mat-expansion-panel-header class="adf-metadata-properties-header"
[class.adf-metadata-properties-header-expanded]='isTagPanelExpanded'>
<adf-content-metadata-header [title]="'METADATA.BASIC.TAGS'" [expanded]="isTagPanelExpanded">
<button *ngIf="canEditTags"
<mat-expansion-panel
hideToggle
[expanded]="currentPanel.panelTitle === DefaultPanels.TAGS && currentPanel.expanded"
(opened)="expandPanel(DefaultPanels.TAGS)"
(closed)="closePanel(DefaultPanels.TAGS)"
class="adf-content-metadata-panel"
data-automation-id="adf-content-metadata-tags-panel">
<mat-expansion-panel-header
class="adf-metadata-properties-header"
[class.adf-metadata-properties-header-expanded]="currentPanel.panelTitle === DefaultPanels.TAGS && currentPanel.expanded">
<adf-content-metadata-header [title]="'METADATA.BASIC.TAGS'" [expanded]="currentPanel.panelTitle === DefaultPanels.TAGS && currentPanel.expanded">
<button
*ngIf="!readOnly && !isPanelEditing(DefaultPanels.TAGS)"
mat-icon-button
(click)="onToggleTagsEdit($event)"
(click)="toggleGroupEditing(DefaultPanels.TAGS, $event)"
[attr.title]="'CORE.METADATA.ACTIONS.EDIT' | translate"
[attr.aria-label]="'CORE.METADATA.ACCESSIBILITY.EDIT' | translate"
data-automation-id="showing-tag-input-button"

View File

@@ -36,12 +36,13 @@ import {
TagsCreatorMode,
TagService
} from '@alfresco/adf-content-services';
import { MatExpansionPanel } from '@angular/material/expansion';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientModule } from '@angular/common/http';
import { MatDialogModule } from '@angular/material/dialog';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatTooltipModule } from '@angular/material/tooltip';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { MatTooltipModule } from '@angular/material/tooltip';
describe('ContentMetadataComponent', () => {
let component: ContentMetadataComponent;
@@ -285,15 +286,11 @@ describe('ContentMetadataComponent', () => {
}));
it('should save changedProperties on save click', fakeAsync(() => {
spyOn(contentMetadataService, 'getGroupedProperties').and.returnValue(
of([
{
getGroupedPropertiesSpy.and.returnValue(of([{
editable: true,
title: 'test',
properties: []
}
])
);
}]));
updateService.itemUpdated$.next({
changed: {}
} as UpdateNotification);
@@ -474,15 +471,11 @@ describe('ContentMetadataComponent', () => {
beforeEach(() => {
showErrorSpy = spyOn(notificationService, 'showError').and.stub();
spyOn(contentMetadataService, 'getGroupedProperties').and.returnValue(
of([
{
getGroupedPropertiesSpy.and.returnValue(of([{
editable: true,
title: 'test',
properties: []
}
])
);
}]));
component.displayCategories = true;
component.displayTags = true;
component.ngOnInit();
@@ -630,15 +623,11 @@ describe('ContentMetadataComponent', () => {
});
it('should reset group edit ability on reset click', () => {
spyOn(contentMetadataService, 'getGroupedProperties').and.returnValue(
of([
{
getGroupedPropertiesSpy.and.returnValue(of([{
editable: true,
title: 'test',
properties: []
}
])
);
}]));
component.ngOnInit();
component.readOnly = false;
fixture.detectChanges();
@@ -702,6 +691,8 @@ describe('ContentMetadataComponent', () => {
});
it('should load the group properties on node change', () => {
getGroupedPropertiesSpy.and.stub();
component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) });
expect(contentMetadataService.getGroupedProperties).toHaveBeenCalledWith(expectedNode, 'custom-preset');
@@ -724,6 +715,7 @@ describe('ContentMetadataComponent', () => {
}
];
component.preset = presetConfig;
getGroupedPropertiesSpy.and.stub();
component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) });
@@ -794,15 +786,11 @@ describe('ContentMetadataComponent', () => {
});
it('should reload properties for group panel on cancel', () => {
const getGroupedPropertiesSpy = spyOn(contentMetadataService, 'getGroupedProperties').and.returnValue(
of([
{
getGroupedPropertiesSpy.and.returnValue(of([{
editable: true,
title: 'test',
properties: []
}
])
);
}]));
component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) });
component.readOnly = false;
fixture.detectChanges();

View File

@@ -83,9 +83,9 @@ describe('DynamicChipListComponent', () => {
fixture.detectChanges();
await fixture.whenStable();
expect(element.querySelector('#adf-dynamic-chip-list-chip-name-0').innerHTML).toBe('test1');
expect(element.querySelector('#adf-dynamic-chip-list-chip-name-1').innerHTML).toBe('test2');
expect(element.querySelector('#adf-dynamic-chip-list-chip-name-2').innerHTML).toBe('test3');
expect(element.querySelector('#adf-dynamic-chip-list-chip-name-0')?.innerHTML).toBe('test1');
expect(element.querySelector('#adf-dynamic-chip-list-chip-name-1')?.innerHTML).toBe('test2');
expect(element.querySelector('#adf-dynamic-chip-list-chip-name-2')?.innerHTML).toBe('test3');
expect(element.querySelector('#adf-dynamic-chip-list-delete-test1')).not.toBe(null);
expect(element.querySelector('#adf-dynamic-chip-list-delete-test2')).not.toBe(null);
@@ -182,6 +182,10 @@ describe('DynamicChipListComponent', () => {
element.style.maxWidth = '309px';
});
afterEach(() =>{
fixture.destroy();
});
it('should render view more button when limiting is enabled', fakeAsync(() => {
renderChips();
component.ngOnChanges({

View File

@@ -18,9 +18,7 @@
import { DebugElement } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { RichTextEditorComponent } from './rich-text-editor.component';
import { take } from 'rxjs';
describe('RichTextEditorComponent', () => {
let component: RichTextEditorComponent;