[ADF 3635] Added translation label to checklist dialog (#3894)

* [ADF-3635] added translation label to checklist dialog

* [ADF-3635] fixed tests
This commit is contained in:
Vito
2018-10-16 18:04:33 +01:00
committed by Eugenio Romano
parent 392bd62610
commit 5378df9425
4 changed files with 27 additions and 12 deletions

View File

@@ -28,16 +28,16 @@
<ng-template #dialog>
<div class="adf-checklist-dialog" id="checklist-dialog">
<h4 matDialogTitle id="add-checklist-title">New Check</h4>
<h4 matDialogTitle id="add-checklist-title">{{ 'ADF_TASK_LIST.DETAILS.CHECKLIST.DIALOG.TITLE' | translate }}</h4>
<mat-dialog-content>
<mat-form-field>
<input matInput placeholder="Name" [(ngModel)]="taskName" id="checklist-name"
<input matInput placeholder="{{ 'ADF_TASK_LIST.DETAILS.CHECKLIST.DIALOG.PLACEHOLDER' | translate }}" [(ngModel)]="taskName" id="checklist-name"
data-automation-id="checklist-name">
</mat-form-field>
</mat-dialog-content>
<mat-dialog-actions class="adf-checklist-dialog-actions">
<button mat-button type="button" id="close-check-dialog" (click)="cancel()">Cancel</button>
<button mat-button type="button" id="add-check" (click)="add()">Add Checklist</button>
<button mat-button type="button" id="close-check-dialog" (click)="cancel()">{{ 'ADF_TASK_LIST.DETAILS.CHECKLIST.DIALOG.CANCEL-BUTTON' | translate }}</button>
<button mat-button type="button" id="add-check" (click)="add()">{{ 'ADF_TASK_LIST.DETAILS.CHECKLIST.DIALOG.ADD-BUTTON' | translate }}</button>
</mat-dialog-actions>
</div>
</ng-template>

View File

@@ -116,13 +116,16 @@ describe('ChecklistComponent', () => {
showChecklistDialog = <HTMLElement> element.querySelector('#add-checklist');
});
it('should show dialog when clicked on add', () => {
it('should show dialog when clicked on add', (done) => {
expect(showChecklistDialog).not.toBeNull();
showChecklistDialog.click();
expect(window.document.querySelector('#checklist-dialog')).not.toBeNull();
expect(window.document.querySelector('#add-checklist-title')).not.toBeNull();
expect(window.document.querySelector('#add-checklist-title').textContent).toContain('New Check');
fixture.detectChanges();
fixture.whenStable().then(() => {
expect(window.document.querySelector('#checklist-dialog')).not.toBeNull();
expect(window.document.querySelector('#add-checklist-title')).not.toBeNull();
expect(window.document.querySelector('#add-checklist-title').textContent).toContain('ADF_TASK_LIST.DETAILS.CHECKLIST.DIALOG.TITLE');
done();
});
});
});