From 5378df9425d67e1dd31f15686baa5ef268a73e70 Mon Sep 17 00:00:00 2001 From: Vito Date: Tue, 16 Oct 2018 18:04:33 +0100 Subject: [PATCH] [ADF 3635] Added translation label to checklist dialog (#3894) * [ADF-3635] added translation label to checklist dialog * [ADF-3635] fixed tests --- lib/process-services/i18n/en.json | 8 +++++++- lib/process-services/i18n/it.json | 10 ++++++++-- .../task-list/components/checklist.component.html | 8 ++++---- .../components/checklist.component.spec.ts | 13 ++++++++----- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/lib/process-services/i18n/en.json b/lib/process-services/i18n/en.json index 487273b211..cc4d227aa6 100644 --- a/lib/process-services/i18n/en.json +++ b/lib/process-services/i18n/en.json @@ -94,7 +94,13 @@ "NONE": "Nobody involved" }, "CHECKLIST": { - "NONE": "No checklist" + "NONE": "No checklist", + "DIALOG" : { + "TITLE": "New Check", + "CANCEL-BUTTON": "Cancel", + "ADD-BUTTON": "Add Checklist", + "PLACEHOLDER": "Name" + } }, "ERROR": { "TITLE": "Couldn't complete the action", diff --git a/lib/process-services/i18n/it.json b/lib/process-services/i18n/it.json index 160731eaf2..6052515f03 100644 --- a/lib/process-services/i18n/it.json +++ b/lib/process-services/i18n/it.json @@ -91,7 +91,13 @@ "NONE": "Nessuno coinvolto" }, "CHECKLIST": { - "NONE": "Nessun elenco di controllo" + "NONE": "Nessun elenco di controllo", + "DIALOG" : { + "TITLE": "Nuova Checklist", + "CANCEL-BUTTON": "Cancella", + "ADD-BUTTON": "Aggiungi Checklist", + "PLACEHOLDER": "Nome" + } }, "ERROR": { "TITLE": "Impossibile completare l'azione", @@ -316,4 +322,4 @@ "CHOOSE": "Scegli" } } -} \ No newline at end of file +} diff --git a/lib/process-services/task-list/components/checklist.component.html b/lib/process-services/task-list/components/checklist.component.html index 4d253fe45f..3a0b5d6766 100644 --- a/lib/process-services/task-list/components/checklist.component.html +++ b/lib/process-services/task-list/components/checklist.component.html @@ -28,16 +28,16 @@
-

New Check

+

{{ 'ADF_TASK_LIST.DETAILS.CHECKLIST.DIALOG.TITLE' | translate }}

- - - + +
diff --git a/lib/process-services/task-list/components/checklist.component.spec.ts b/lib/process-services/task-list/components/checklist.component.spec.ts index 44f84023b8..cb304fc9eb 100644 --- a/lib/process-services/task-list/components/checklist.component.spec.ts +++ b/lib/process-services/task-list/components/checklist.component.spec.ts @@ -116,13 +116,16 @@ describe('ChecklistComponent', () => { showChecklistDialog = 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(); + }); }); });