From bd29a9dcf5977409adc7fa18a4d4f08bc6f381a7 Mon Sep 17 00:00:00 2001 From: Martin Dragnev Date: Thu, 12 Dec 2024 16:59:27 +0200 Subject: [PATCH 1/4] fix(i18n): Cancel and Apply buttons to start with capital letter --- projects/igniteui-angular/src/lib/core/i18n/grid-resources.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/igniteui-angular/src/lib/core/i18n/grid-resources.ts b/projects/igniteui-angular/src/lib/core/i18n/grid-resources.ts index 530ff4bc3f9..416a65aadf0 100644 --- a/projects/igniteui-angular/src/lib/core/i18n/grid-resources.ts +++ b/projects/igniteui-angular/src/lib/core/i18n/grid-resources.ts @@ -235,8 +235,8 @@ export const GridResourceStringsEN: IGridResourceStrings = { igx_grid_excel_custom_dialog_add: 'add filter', igx_grid_excel_custom_dialog_clear: 'Clear filter', igx_grid_excel_custom_dialog_header: 'Custom auto-filter on column: ', - igx_grid_excel_cancel: 'cancel', - igx_grid_excel_apply: 'apply', + igx_grid_excel_cancel: 'Cancel', + igx_grid_excel_apply: 'Apply', igx_grid_excel_search_placeholder: 'Search', igx_grid_excel_select_all: 'Select All', igx_grid_excel_select_all_search_results: 'Select all search results', From d756de622d31d2187d9f19ca9fd1932d3012e212 Mon Sep 17 00:00:00 2001 From: Martin Dragnev Date: Thu, 12 Dec 2024 17:13:50 +0200 Subject: [PATCH 2/4] chore(*): fix tests --- .../src/lib/test-utils/grid-functions.spec.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/igniteui-angular/src/lib/test-utils/grid-functions.spec.ts b/projects/igniteui-angular/src/lib/test-utils/grid-functions.spec.ts index 3a2ab1e9f4a..758f6687333 100644 --- a/projects/igniteui-angular/src/lib/test-utils/grid-functions.spec.ts +++ b/projects/igniteui-angular/src/lib/test-utils/grid-functions.spec.ts @@ -737,7 +737,7 @@ export class GridFunctions { public static getApplyButtonExcelStyleFiltering(fix: ComponentFixture, menu = null, grid = 'igx-grid') { const excelMenu = menu ? menu : GridFunctions.getExcelStyleFilteringComponent(fix, grid); const containedButtons = Array.from(excelMenu.querySelectorAll('.igx-button--contained')); - const applyButton: any = containedButtons.find((rb: any) => rb.innerText === 'apply'); + const applyButton: any = containedButtons.find((rb: any) => rb.innerText === 'Apply'); return applyButton; } @@ -749,7 +749,7 @@ export class GridFunctions { public static clickCancelExcelStyleFiltering(fix: ComponentFixture, menu = null) { const excelMenu = menu ? menu : GridFunctions.getExcelStyleFilteringComponent(fix); const flatButtons = Array.from(excelMenu.querySelectorAll('.igx-button--flat')); - const cancelButton: any = flatButtons.find((rb: any) => rb.innerText === 'cancel'); + const cancelButton: any = flatButtons.find((rb: any) => rb.innerText === 'Cancel'); cancelButton.click(); } @@ -770,7 +770,7 @@ export class GridFunctions { public static getApplyExcelStyleCustomFiltering(fix: ComponentFixture): HTMLElement { const customFilterMenu = GridFunctions.getExcelStyleCustomFilteringDialog(fix); const containedButtons = Array.from(customFilterMenu.querySelectorAll('.igx-button--contained')); - const applyButton = containedButtons.find((rb: any) => rb.innerText === 'apply'); + const applyButton = containedButtons.find((rb: any) => rb.innerText === 'Apply'); return applyButton as HTMLElement; } @@ -803,7 +803,7 @@ export class GridFunctions { public static clickCancelExcelStyleCustomFiltering(fix: ComponentFixture) { const customFilterMenu = GridFunctions.getExcelStyleCustomFilteringDialog(fix); const flatButtons = Array.from(customFilterMenu.querySelectorAll('.igx-button--flat')); - const cancelButton: any = flatButtons.find((rb: any) => rb.innerText === 'cancel'); + const cancelButton: any = flatButtons.find((rb: any) => rb.innerText === 'Cancel'); cancelButton.click(); } @@ -1676,14 +1676,14 @@ export class GridFunctions { public static getAdvancedFilteringCancelButton(fix: ComponentFixture) { const footer = GridFunctions.getAdvancedFilteringFooter(fix); const cancelFilterButton: any = Array.from(footer.querySelectorAll('button')) - .find((b: any) => b.innerText.toLowerCase() === 'cancel'); + .find((b: any) => b.innerText.toLowerCase() === 'Cancel'); return cancelFilterButton; } public static getAdvancedFilteringApplyButton(fix: ComponentFixture) { const footer = GridFunctions.getAdvancedFilteringFooter(fix); const applyFilterButton: any = Array.from(footer.querySelectorAll('button')) - .find((b: any) => b.innerText.toLowerCase() === 'apply'); + .find((b: any) => b.innerText.toLowerCase() === 'Apply'); return applyFilterButton; } From 41e23d4539db02fb988fc9c6173f62d5b86698eb Mon Sep 17 00:00:00 2001 From: Martin Dragnev Date: Fri, 13 Dec 2024 10:04:33 +0200 Subject: [PATCH 3/4] chore(*): fix tests --- .../src/lib/test-utils/grid-functions.spec.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/projects/igniteui-angular/src/lib/test-utils/grid-functions.spec.ts b/projects/igniteui-angular/src/lib/test-utils/grid-functions.spec.ts index 758f6687333..6801c1139f4 100644 --- a/projects/igniteui-angular/src/lib/test-utils/grid-functions.spec.ts +++ b/projects/igniteui-angular/src/lib/test-utils/grid-functions.spec.ts @@ -737,7 +737,7 @@ export class GridFunctions { public static getApplyButtonExcelStyleFiltering(fix: ComponentFixture, menu = null, grid = 'igx-grid') { const excelMenu = menu ? menu : GridFunctions.getExcelStyleFilteringComponent(fix, grid); const containedButtons = Array.from(excelMenu.querySelectorAll('.igx-button--contained')); - const applyButton: any = containedButtons.find((rb: any) => rb.innerText === 'Apply'); + const applyButton: any = containedButtons.find((rb: any) => rb.innerText.toLowerCase() === 'apply'); return applyButton; } @@ -749,7 +749,7 @@ export class GridFunctions { public static clickCancelExcelStyleFiltering(fix: ComponentFixture, menu = null) { const excelMenu = menu ? menu : GridFunctions.getExcelStyleFilteringComponent(fix); const flatButtons = Array.from(excelMenu.querySelectorAll('.igx-button--flat')); - const cancelButton: any = flatButtons.find((rb: any) => rb.innerText === 'Cancel'); + const cancelButton: any = flatButtons.find((rb: any) => rb.innerText === 'cancel'); cancelButton.click(); } @@ -770,7 +770,7 @@ export class GridFunctions { public static getApplyExcelStyleCustomFiltering(fix: ComponentFixture): HTMLElement { const customFilterMenu = GridFunctions.getExcelStyleCustomFilteringDialog(fix); const containedButtons = Array.from(customFilterMenu.querySelectorAll('.igx-button--contained')); - const applyButton = containedButtons.find((rb: any) => rb.innerText === 'Apply'); + const applyButton = containedButtons.find((rb: any) => rb.innerText.toLowerCase() === 'apply'); return applyButton as HTMLElement; } @@ -803,7 +803,7 @@ export class GridFunctions { public static clickCancelExcelStyleCustomFiltering(fix: ComponentFixture) { const customFilterMenu = GridFunctions.getExcelStyleCustomFilteringDialog(fix); const flatButtons = Array.from(customFilterMenu.querySelectorAll('.igx-button--flat')); - const cancelButton: any = flatButtons.find((rb: any) => rb.innerText === 'Cancel'); + const cancelButton: any = flatButtons.find((rb: any) => rb.innerText.toLowerCase() === 'cancel'); cancelButton.click(); } @@ -1676,14 +1676,14 @@ export class GridFunctions { public static getAdvancedFilteringCancelButton(fix: ComponentFixture) { const footer = GridFunctions.getAdvancedFilteringFooter(fix); const cancelFilterButton: any = Array.from(footer.querySelectorAll('button')) - .find((b: any) => b.innerText.toLowerCase() === 'Cancel'); + .find((b: any) => b.innerText.toLowerCase() === 'cancel'); return cancelFilterButton; } public static getAdvancedFilteringApplyButton(fix: ComponentFixture) { const footer = GridFunctions.getAdvancedFilteringFooter(fix); const applyFilterButton: any = Array.from(footer.querySelectorAll('button')) - .find((b: any) => b.innerText.toLowerCase() === 'Apply'); + .find((b: any) => b.innerText.toLowerCase() === 'apply'); return applyFilterButton; } From 53a39d61fe2f052f531608d1a9cfbb5a70e39637 Mon Sep 17 00:00:00 2001 From: Martin Dragnev Date: Fri, 13 Dec 2024 10:16:19 +0200 Subject: [PATCH 4/4] chore(*): add missing toLowerCase --- .../igniteui-angular/src/lib/test-utils/grid-functions.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/igniteui-angular/src/lib/test-utils/grid-functions.spec.ts b/projects/igniteui-angular/src/lib/test-utils/grid-functions.spec.ts index 6801c1139f4..93f2bb35078 100644 --- a/projects/igniteui-angular/src/lib/test-utils/grid-functions.spec.ts +++ b/projects/igniteui-angular/src/lib/test-utils/grid-functions.spec.ts @@ -749,7 +749,7 @@ export class GridFunctions { public static clickCancelExcelStyleFiltering(fix: ComponentFixture, menu = null) { const excelMenu = menu ? menu : GridFunctions.getExcelStyleFilteringComponent(fix); const flatButtons = Array.from(excelMenu.querySelectorAll('.igx-button--flat')); - const cancelButton: any = flatButtons.find((rb: any) => rb.innerText === 'cancel'); + const cancelButton: any = flatButtons.find((rb: any) => rb.innerText.toLowerCase() === 'cancel'); cancelButton.click(); }