[ADF-5064] Info Drawer - More and Less Information buttons are reversed (#5405)

* display correct button for state

* update tests

* update tests
This commit is contained in:
Cilibiu Bogdan
2020-01-27 14:07:44 +02:00
committed by Eugenio Romano
parent 3767ecb91c
commit f8d3b29ff5
3 changed files with 8 additions and 8 deletions

View File

@@ -119,8 +119,8 @@ describe('Metadata component', () => {
await metadataViewPage.editIconIsDisplayed(); await metadataViewPage.editIconIsDisplayed();
await metadataViewPage.informationButtonIsDisplayed(); await metadataViewPage.informationButtonIsDisplayed();
await expect(await metadataViewPage.getInformationButtonText()).toEqual(METADATA.LESS_INFO_BUTTON); await expect(await metadataViewPage.getInformationButtonText()).toEqual(METADATA.MORE_INFO_BUTTON);
await expect(await metadataViewPage.getInformationIconText()).toEqual(METADATA.ARROW_UP); await expect(await metadataViewPage.getInformationIconText()).toEqual(METADATA.ARROW_DOWN);
}); });
it('[C272769] Should be possible to display more details when clicking on More Information button', async () => { it('[C272769] Should be possible to display more details when clicking on More Information button', async () => {
@@ -129,8 +129,8 @@ describe('Metadata component', () => {
await metadataViewPage.clickOnPropertiesTab(); await metadataViewPage.clickOnPropertiesTab();
await metadataViewPage.informationButtonIsDisplayed(); await metadataViewPage.informationButtonIsDisplayed();
await metadataViewPage.clickOnInformationButton(); await metadataViewPage.clickOnInformationButton();
await expect(await metadataViewPage.getInformationButtonText()).toEqual(METADATA.MORE_INFO_BUTTON); await expect(await metadataViewPage.getInformationButtonText()).toEqual(METADATA.LESS_INFO_BUTTON);
await expect(await metadataViewPage.getInformationIconText()).toEqual(METADATA.ARROW_DOWN); await expect(await metadataViewPage.getInformationIconText()).toEqual(METADATA.ARROW_UP);
}); });
it('[C270952] Should be possible to open/close properties using info icon', async () => { it('[C270952] Should be possible to open/close properties using info icon', async () => {

View File

@@ -23,11 +23,11 @@
</button> </button>
</div> </div>
<button *ngIf="displayDefaultProperties" mat-button (click)="toggleExpanded()" data-automation-id="meta-data-card-toggle-expand"> <button *ngIf="displayDefaultProperties" mat-button (click)="toggleExpanded()" data-automation-id="meta-data-card-toggle-expand">
<ng-container *ngIf="expanded"> <ng-container *ngIf="!expanded">
<span data-automation-id="meta-data-card-toggle-expand-label">{{ 'ADF_VIEWER.SIDEBAR.METADATA.MORE_INFORMATION' | translate }}</span> <span data-automation-id="meta-data-card-toggle-expand-label">{{ 'ADF_VIEWER.SIDEBAR.METADATA.MORE_INFORMATION' | translate }}</span>
<mat-icon>keyboard_arrow_down</mat-icon> <mat-icon>keyboard_arrow_down</mat-icon>
</ng-container> </ng-container>
<ng-container *ngIf="!expanded"> <ng-container *ngIf="expanded">
<span data-automation-id="meta-data-card-toggle-expand-label">{{ 'ADF_VIEWER.SIDEBAR.METADATA.LESS_INFORMATION' | translate }}</span> <span data-automation-id="meta-data-card-toggle-expand-label">{{ 'ADF_VIEWER.SIDEBAR.METADATA.LESS_INFORMATION' | translate }}</span>
<mat-icon>keyboard_arrow_up</mat-icon> <mat-icon>keyboard_arrow_up</mat-icon>
</ng-container> </ng-container>

View File

@@ -153,7 +153,7 @@ describe('ContentMetadataCardComponent', () => {
const buttonLabel = fixture.debugElement.query(By.css('[data-automation-id="meta-data-card-toggle-expand-label"]')); const buttonLabel = fixture.debugElement.query(By.css('[data-automation-id="meta-data-card-toggle-expand-label"]'));
expect(buttonLabel.nativeElement.innerText.trim()).toBe('ADF_VIEWER.SIDEBAR.METADATA.LESS_INFORMATION'); expect(buttonLabel.nativeElement.innerText.trim()).toBe('ADF_VIEWER.SIDEBAR.METADATA.MORE_INFORMATION');
}); });
it('should have the proper text on button while collapsed', () => { it('should have the proper text on button while collapsed', () => {
@@ -162,7 +162,7 @@ describe('ContentMetadataCardComponent', () => {
const buttonLabel = fixture.debugElement.query(By.css('[data-automation-id="meta-data-card-toggle-expand-label"]')); const buttonLabel = fixture.debugElement.query(By.css('[data-automation-id="meta-data-card-toggle-expand-label"]'));
expect(buttonLabel.nativeElement.innerText.trim()).toBe('ADF_VIEWER.SIDEBAR.METADATA.MORE_INFORMATION'); expect(buttonLabel.nativeElement.innerText.trim()).toBe('ADF_VIEWER.SIDEBAR.METADATA.LESS_INFORMATION');
}); });
it('should hide the edit button in readOnly is true', () => { it('should hide the edit button in readOnly is true', () => {