mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3298] Select CardView item label removed (#3555)
* placeholder removed * test added
This commit is contained in:
committed by
Eugenio Romano
parent
ef866fdbdb
commit
1bba43af8c
@@ -3,7 +3,7 @@
|
|||||||
<div *ngIf="!isEditable()" data-automation-class="read-only-value">{{ property.displayValue | async }}</div>
|
<div *ngIf="!isEditable()" data-automation-class="read-only-value">{{ property.displayValue | async }}</div>
|
||||||
<div *ngIf="isEditable()">
|
<div *ngIf="isEditable()">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<mat-select placeholder="{{ property.label | translate }}" [(value)]="value" (change)="onChange($event)" data-automation-class="select-box">
|
<mat-select [(value)]="value" (change)="onChange($event)" data-automation-class="select-box">
|
||||||
<mat-option *ngFor="let option of getOptions() | async" [value]="option.key">
|
<mat-option *ngFor="let option of getOptions() | async" [value]="option.key">
|
||||||
{{ option.label | translate }}
|
{{ option.label | translate }}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
|
@@ -87,6 +87,15 @@ describe('CardViewSelectItemComponent', () => {
|
|||||||
expect(selectBox).not.toBeNull();
|
expect(selectBox).not.toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should not have label twice', () => {
|
||||||
|
component.ngOnChanges();
|
||||||
|
component.editable = true;
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
const label = fixture.debugElement.query(By.css('[data-automation-class="select-box"] .mat-form-field-label'));
|
||||||
|
expect(label).toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
it('should update property on input blur', async(() => {
|
it('should update property on input blur', async(() => {
|
||||||
spyOn(cardViewUpdateService, 'update');
|
spyOn(cardViewUpdateService, 'update');
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@ import { CardViewSelectItemProperties } from '../interfaces/card-view.interfaces
|
|||||||
import { of } from 'rxjs/observable/of';
|
import { of } from 'rxjs/observable/of';
|
||||||
|
|
||||||
describe('CardViewSelectItemModel', () => {
|
describe('CardViewSelectItemModel', () => {
|
||||||
let properties: CardViewSelectItemProperties;
|
let properties: CardViewSelectItemProperties<string>;
|
||||||
const mockData = [{ key: 'one', label: 'One' }, { key: 'two', label: 'Two' }, { key: 'three', label: 'Three' }];
|
const mockData = [{ key: 'one', label: 'One' }, { key: 'two', label: 'Two' }, { key: 'three', label: 'Three' }];
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
Reference in New Issue
Block a user