From 264b2f746651ee6e4ed773665e9bd9b366e811c2 Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Wed, 6 Sep 2023 18:47:08 +0400 Subject: [PATCH 01/16] aria-selected can't be used with role presentation --- packages/devextreme/js/ui/gallery.js | 1 + .../testing/tests/DevExpress.ui.widgets/gallery.tests.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/devextreme/js/ui/gallery.js b/packages/devextreme/js/ui/gallery.js index ab5b26b184fa..731d7f8e8f51 100644 --- a/packages/devextreme/js/ui/gallery.js +++ b/packages/devextreme/js/ui/gallery.js @@ -395,6 +395,7 @@ const Gallery = CollectionWidget.inherit({ .css('margin', 0) .appendTo($container); + $clonedItem.removeAttr('aria-selected'); this.setAria({ role: 'presentation' }, $clonedItem); } }, diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js index 437f9226aa3b..61f23295cb26 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js @@ -385,7 +385,7 @@ QUnit.module('behavior', { assert.equal($loopItems.length, 2); }); - QUnit.test('duplicate items should have role="presentation"', function(assert) { + QUnit.test('duplicate items should have role="presentation" and do not have "aria-selected" attr', function(assert) { const $gallery = this.$element.dxGallery({ items: [0, 1, 2, 3], loop: true @@ -394,6 +394,7 @@ QUnit.module('behavior', { const $loopItems = $gallery.find(`.${GALLERY_LOOP_ITEM_CLASS}`); $loopItems.each((index, item) => { assert.strictEqual($(item).attr('role'), 'presentation'); + assert.strictEqual($(item).attr('aria-selected'), undefined); }); }); From dc5b20ffc4b3b243d06615176b857053a57189c5 Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Tue, 12 Sep 2023 19:43:53 +0400 Subject: [PATCH 02/16] Fix issues --- packages/devextreme/js/ui/gallery.js | 10 ++++--- .../gallery.markup.tests.js | 26 +++++++++++++++++++ .../DevExpress.ui.widgets/gallery.tests.js | 5 ++-- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/packages/devextreme/js/ui/gallery.js b/packages/devextreme/js/ui/gallery.js index 731d7f8e8f51..333e22c491dc 100644 --- a/packages/devextreme/js/ui/gallery.js +++ b/packages/devextreme/js/ui/gallery.js @@ -146,7 +146,10 @@ const Gallery = CollectionWidget.inherit({ */ - _itemAttributes: { role: 'option' }, + _itemAttributes: { + role: 'option', + 'aria-label': 'item' + }, loopItemFocus: false, selectOnFocus: true, selectionMode: 'single', @@ -395,8 +398,7 @@ const Gallery = CollectionWidget.inherit({ .css('margin', 0) .appendTo($container); - $clonedItem.removeAttr('aria-selected'); - this.setAria({ role: 'presentation' }, $clonedItem); + this.setAria({ hidden: true }, $clonedItem); } }, @@ -947,7 +949,7 @@ const Gallery = CollectionWidget.inherit({ _setFocusOnSelect: function() { this._userInteraction = true; - const selectedItem = this.itemElements().filter('.' + GALLERY_ITEM_SELECTED_CLASS); + const selectedItem = this._getRealItems().filter('.' + GALLERY_ITEM_SELECTED_CLASS); this.option('focusedElement', getPublicElement(selectedItem)); this._userInteraction = false; }, diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js index 205c82f69f00..93c12cb2a2a4 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js @@ -78,6 +78,32 @@ QUnit.module('aria accessibility', () => { assert.equal($element.attr('aria-label'), 'gallery', 'widget should have aria-label to have difference from text list'); }); + QUnit.test('aria label for items', function(assert) { + const $gallery = $('#gallerySimple').dxGallery({ items: [1] }); + + const $item = $gallery.find('.dx-gallery-item'); + + assert.equal($item.attr('aria-label'), 'item', 'item should have "aria-label"'); + }); + + QUnit.test('aria-activedescendant should have link to one element only', function(assert) { + const $gallery = $('#gallerySimple').dxGallery({ + height: 100, + width: '100%', + showIndicator: false, + items: [1, 2], + loop: true + }); + + const $items = $gallery.find('.dx-gallery-item'); + + const itemsWithId = Array.from($items).filter(item => { + return Boolean($(item).attr('id')); + }); + + assert.strictEqual(itemsWithId.length, 1, 'id attribute should be exist only on one item'); + }); + QUnit.test('aria role for items', function(assert) { const $element = $('#gallerySimple').dxGallery({ items: [1] }); const $item = $element.find('.' + GALLERY_ITEM_CLASS); diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js index 61f23295cb26..8a1e40a4035f 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js @@ -385,7 +385,7 @@ QUnit.module('behavior', { assert.equal($loopItems.length, 2); }); - QUnit.test('duplicate items should have role="presentation" and do not have "aria-selected" attr', function(assert) { + QUnit.test('duplicate items should be hidden for readres', function(assert) { const $gallery = this.$element.dxGallery({ items: [0, 1, 2, 3], loop: true @@ -393,8 +393,7 @@ QUnit.module('behavior', { const $loopItems = $gallery.find(`.${GALLERY_LOOP_ITEM_CLASS}`); $loopItems.each((index, item) => { - assert.strictEqual($(item).attr('role'), 'presentation'); - assert.strictEqual($(item).attr('aria-selected'), undefined); + assert.strictEqual($(item).attr('aria-hidden'), 'true'); }); }); From b7e0f3e176c62349888412f138b391e186ee8cb8 Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Wed, 13 Sep 2023 12:08:44 +0400 Subject: [PATCH 03/16] fix SSR tests --- .../DevExpress.ui.widgets/gallery.markup.tests.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js index 93c12cb2a2a4..e01b5379648a 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js @@ -81,7 +81,7 @@ QUnit.module('aria accessibility', () => { QUnit.test('aria label for items', function(assert) { const $gallery = $('#gallerySimple').dxGallery({ items: [1] }); - const $item = $gallery.find('.dx-gallery-item'); + const $item = $gallery.find(`.${GALLERY_ITEM_CLASS}`); assert.equal($item.attr('aria-label'), 'item', 'item should have "aria-label"'); }); @@ -95,13 +95,17 @@ QUnit.module('aria accessibility', () => { loop: true }); - const $items = $gallery.find('.dx-gallery-item'); + const $items = $gallery.find(`.${GALLERY_ITEM_CLASS}`); const itemsWithId = Array.from($items).filter(item => { return Boolean($(item).attr('id')); }); - assert.strictEqual(itemsWithId.length, 1, 'id attribute should be exist only on one item'); + if(windowUtils.hasWindow()) { + assert.strictEqual(itemsWithId.length, 1, 'id attribute should be exist only on one item'); + } else { + assert.strictEqual(itemsWithId.length, 0, 'no rendered elements'); + } }); QUnit.test('aria role for items', function(assert) { From 6228a464362e0a18c7bd743a7639f3febec46595 Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Wed, 13 Sep 2023 16:51:52 +0400 Subject: [PATCH 04/16] fixes --- packages/devextreme/js/ui/gallery.js | 1 + .../gallery.markup.tests.js | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/packages/devextreme/js/ui/gallery.js b/packages/devextreme/js/ui/gallery.js index 333e22c491dc..891c00fec846 100644 --- a/packages/devextreme/js/ui/gallery.js +++ b/packages/devextreme/js/ui/gallery.js @@ -395,6 +395,7 @@ const Gallery = CollectionWidget.inherit({ const $clonedItem = $(item) .clone(false) .addClass(GALLERY_LOOP_ITEM_CLASS) + .removeAttr('id') .css('margin', 0) .appendTo($container); diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js index e01b5379648a..c384df9ce636 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js @@ -108,6 +108,27 @@ QUnit.module('aria accessibility', () => { } }); + QUnit.test('aria-activedescendant should have link to one element only when width was not set', function(assert) { + const $gallery = $('#gallerySimple').dxGallery({ + height: 100, + showIndicator: false, + items: [1, 2], + loop: true + }); + + const $items = $gallery.find(`.${GALLERY_ITEM_CLASS}`); + + const itemsWithId = Array.from($items).filter(item => { + return Boolean($(item).attr('id')); + }); + + if(windowUtils.hasWindow()) { + assert.strictEqual(itemsWithId.length, 1, 'id attribute should be exist only on one item'); + } else { + assert.strictEqual(itemsWithId.length, 0, 'no rendered elements'); + } + }); + QUnit.test('aria role for items', function(assert) { const $element = $('#gallerySimple').dxGallery({ items: [1] }); const $item = $element.find('.' + GALLERY_ITEM_CLASS); From a111f26c1be581ea9f22054b870402d10fe6fbaa Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Wed, 13 Sep 2023 16:59:26 +0400 Subject: [PATCH 05/16] change aria-label value --- packages/devextreme/js/ui/gallery.js | 2 +- .../testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/devextreme/js/ui/gallery.js b/packages/devextreme/js/ui/gallery.js index 891c00fec846..f7d096d12b4f 100644 --- a/packages/devextreme/js/ui/gallery.js +++ b/packages/devextreme/js/ui/gallery.js @@ -148,7 +148,7 @@ const Gallery = CollectionWidget.inherit({ _itemAttributes: { role: 'option', - 'aria-label': 'item' + 'aria-label': 'gallery item' }, loopItemFocus: false, selectOnFocus: true, diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js index c384df9ce636..3a4441f78cae 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js @@ -83,7 +83,7 @@ QUnit.module('aria accessibility', () => { const $item = $gallery.find(`.${GALLERY_ITEM_CLASS}`); - assert.equal($item.attr('aria-label'), 'item', 'item should have "aria-label"'); + assert.equal($item.attr('aria-label'), 'gallery item', 'item should have "aria-label"'); }); QUnit.test('aria-activedescendant should have link to one element only', function(assert) { From 47a0c8a7b3fa8c5b50e3849b7f7981b102587140 Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Wed, 13 Sep 2023 19:34:24 +0400 Subject: [PATCH 06/16] add testcafe test --- .../testcafe/tests/gallery/accessibility.ts | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts diff --git a/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts b/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts new file mode 100644 index 000000000000..ac94471f3c47 --- /dev/null +++ b/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts @@ -0,0 +1,50 @@ +/* eslint-disable no-restricted-syntax */ +import url from '../../helpers/getPageUrl'; +import createWidget from '../../helpers/createWidget'; +import { a11yCheck } from '../../helpers/accessibilityUtils'; + +fixture.disablePageReloads`Gallery` + .page(url(__dirname, '../../container.html')); + +function getGallerySettings(settings) { + const items = [{ + ID: '1', + Name: 'First', + }, + { + ID: '2', + Name: 'Second', + }]; + + return { + items, + height: 100, + loop: true, + itemTemplate(item) { + const result = document.createElement('div'); + const span = document.createElement('span'); + + span.innerText = item.name; + result.appendChild(span); + + return result; + }, + ...settings, + }; +} + +test('Checking Gallery via aXe when width was not set', async (t) => { + await a11yCheck(t); +}).before(async () => createWidget( + 'dxGallery', + getGallerySettings({}), +)); + +test('Checking Gallery via aXe when width was set', async (t) => { + await a11yCheck(t); +}).before(async () => createWidget( + 'dxGallery', + getGallerySettings({ + width: '100%', + }), +)); From a5e5e5c8d7ef66bbd1eca5b9ff0f9c78f5adb330 Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Thu, 14 Sep 2023 15:32:31 +0400 Subject: [PATCH 07/16] hide role for empty gallery + tests refactor --- packages/devextreme/js/ui/gallery.js | 9 ++- .../gallery.markup.tests.js | 55 +++------------- .../DevExpress.ui.widgets/gallery.tests.js | 63 +++++++++++++++---- 3 files changed, 67 insertions(+), 60 deletions(-) diff --git a/packages/devextreme/js/ui/gallery.js b/packages/devextreme/js/ui/gallery.js index f7d096d12b4f..12dd02e39465 100644 --- a/packages/devextreme/js/ui/gallery.js +++ b/packages/devextreme/js/ui/gallery.js @@ -276,10 +276,13 @@ const Gallery = CollectionWidget.inherit({ this.callBase(); - this.setAria({ - 'role': 'listbox', + const listBoxRoleShouldBe = this._itemsCount() > 0; + const ariaAttrs = { + 'role': listBoxRoleShouldBe ? 'listbox' : undefined, 'label': 'gallery' - }); + }; + + this.setAria(ariaAttrs); }, _render: function() { diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js index 3a4441f78cae..dcea1ead8c34 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js @@ -66,9 +66,15 @@ QUnit.module('base', () => { QUnit.module('aria accessibility', () => { - QUnit.test('aria role', function(assert) { + QUnit.test('aria role should not be set when no items', function(assert) { const $element = $('#gallerySimple').dxGallery(); + assert.equal($element.attr('role'), undefined, 'aria role is correct'); + }); + + QUnit.test('aria role should be set when gallery has items to display', function(assert) { + const $element = $('#gallerySimple').dxGallery({ items: [1] }); + assert.equal($element.attr('role'), 'listbox', 'aria role is correct'); }); @@ -78,55 +84,12 @@ QUnit.module('aria accessibility', () => { assert.equal($element.attr('aria-label'), 'gallery', 'widget should have aria-label to have difference from text list'); }); - QUnit.test('aria label for items', function(assert) { + QUnit.test('aria label for items should be set', function(assert) { const $gallery = $('#gallerySimple').dxGallery({ items: [1] }); const $item = $gallery.find(`.${GALLERY_ITEM_CLASS}`); - assert.equal($item.attr('aria-label'), 'gallery item', 'item should have "aria-label"'); - }); - - QUnit.test('aria-activedescendant should have link to one element only', function(assert) { - const $gallery = $('#gallerySimple').dxGallery({ - height: 100, - width: '100%', - showIndicator: false, - items: [1, 2], - loop: true - }); - - const $items = $gallery.find(`.${GALLERY_ITEM_CLASS}`); - - const itemsWithId = Array.from($items).filter(item => { - return Boolean($(item).attr('id')); - }); - - if(windowUtils.hasWindow()) { - assert.strictEqual(itemsWithId.length, 1, 'id attribute should be exist only on one item'); - } else { - assert.strictEqual(itemsWithId.length, 0, 'no rendered elements'); - } - }); - - QUnit.test('aria-activedescendant should have link to one element only when width was not set', function(assert) { - const $gallery = $('#gallerySimple').dxGallery({ - height: 100, - showIndicator: false, - items: [1, 2], - loop: true - }); - - const $items = $gallery.find(`.${GALLERY_ITEM_CLASS}`); - - const itemsWithId = Array.from($items).filter(item => { - return Boolean($(item).attr('id')); - }); - - if(windowUtils.hasWindow()) { - assert.strictEqual(itemsWithId.length, 1, 'id attribute should be exist only on one item'); - } else { - assert.strictEqual(itemsWithId.length, 0, 'no rendered elements'); - } + assert.strictEqual($item.attr('aria-label'), 'gallery item', 'item should have "aria-label"'); }); QUnit.test('aria role for items', function(assert) { diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js index 8a1e40a4035f..cf6a17df8e70 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js @@ -385,17 +385,6 @@ QUnit.module('behavior', { assert.equal($loopItems.length, 2); }); - QUnit.test('duplicate items should be hidden for readres', function(assert) { - const $gallery = this.$element.dxGallery({ - items: [0, 1, 2, 3], - loop: true - }); - - const $loopItems = $gallery.find(`.${GALLERY_LOOP_ITEM_CLASS}`); - $loopItems.each((index, item) => { - assert.strictEqual($(item).attr('aria-hidden'), 'true'); - }); - }); QUnit.test('duplicate items is not rendered when loop=false', function(assert) { const $gallery = this.$element.dxGallery({ @@ -2762,3 +2751,55 @@ QUnit.module('gallery with paginated dataSource', { }); }); +QUnit.module('accessibility', function() { + QUnit.test('duplicate items should have aria-hidden=true', function(assert) { + const $gallery = $('#gallerySimple').dxGallery({ + items: [0, 1, 2, 3], + loop: true + }); + + const $loopItems = $gallery.find(`.${GALLERY_LOOP_ITEM_CLASS}`); + $loopItems.each((index, item) => { + assert.strictEqual($(item).attr('aria-hidden'), 'true'); + }); + }); + + QUnit.test('aria-activedescendant should have link to one element only', function(assert) { + const $gallery = $('#gallerySimple').dxGallery({ + height: 100, + width: '100%', + showIndicator: false, + items: [1, 2], + loop: true + }); + + const $items = $gallery.find(`.${GALLERY_ITEM_CLASS}`); + + const itemsWithId = Array.from($items).filter(item => { + return Boolean($(item).attr('id')); + }); + + assert.strictEqual(itemsWithId.length, 1, 'id attribute should be exist only on one item'); + }); + + QUnit.test('aria-activedescendant should have link to one element only after resize', function(assert) { + const $gallery = $('#gallerySimple').dxGallery({ + height: 100, + showIndicator: false, + width: '100%', + items: [1, 2], + loop: true + }); + + $gallery.dxGallery('instance').option('width', 200); + + const $items = $gallery.find(`.${GALLERY_ITEM_CLASS}`); + + const itemsWithId = Array.from($items).filter(item => { + return Boolean($(item).attr('id')); + }); + + assert.strictEqual(itemsWithId.length, 1, 'id attribute should be exist only on one item'); + }); + +}); From 729bc09cc30fa6ec81ec29376dea71755242d99e Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Thu, 14 Sep 2023 16:24:23 +0400 Subject: [PATCH 08/16] add lacalization --- packages/devextreme/js/localization/messages/ar.json | 4 +++- packages/devextreme/js/localization/messages/ca.json | 4 +++- packages/devextreme/js/localization/messages/cs.json | 4 +++- packages/devextreme/js/localization/messages/de.json | 4 +++- packages/devextreme/js/localization/messages/el.json | 4 +++- packages/devextreme/js/localization/messages/en.json | 4 +++- packages/devextreme/js/localization/messages/es.json | 4 +++- packages/devextreme/js/localization/messages/fa.json | 4 +++- packages/devextreme/js/localization/messages/fi.json | 4 +++- packages/devextreme/js/localization/messages/fr.json | 4 +++- packages/devextreme/js/localization/messages/hu.json | 4 +++- packages/devextreme/js/localization/messages/it.json | 4 +++- packages/devextreme/js/localization/messages/ja.json | 4 +++- packages/devextreme/js/localization/messages/lt.json | 4 +++- packages/devextreme/js/localization/messages/lv.json | 4 +++- packages/devextreme/js/localization/messages/nb.json | 4 +++- packages/devextreme/js/localization/messages/nl.json | 4 +++- packages/devextreme/js/localization/messages/pt.json | 4 +++- packages/devextreme/js/localization/messages/ro.json | 4 +++- packages/devextreme/js/localization/messages/ru.json | 4 +++- packages/devextreme/js/localization/messages/sl.json | 4 +++- packages/devextreme/js/localization/messages/sv.json | 4 +++- packages/devextreme/js/localization/messages/tr.json | 4 +++- packages/devextreme/js/localization/messages/vi.json | 4 +++- packages/devextreme/js/localization/messages/zh-tw.json | 4 +++- packages/devextreme/js/localization/messages/zh.json | 4 +++- packages/devextreme/js/ui/gallery.js | 3 ++- .../tests/DevExpress.ui.widgets/gallery.markup.tests.js | 2 +- 28 files changed, 81 insertions(+), 28 deletions(-) diff --git a/packages/devextreme/js/localization/messages/ar.json b/packages/devextreme/js/localization/messages/ar.json index 945c40de21f1..1c09c531f97b 100644 --- a/packages/devextreme/js/localization/messages/ar.json +++ b/packages/devextreme/js/localization/messages/ar.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/ca.json b/packages/devextreme/js/localization/messages/ca.json index 4540fba4db58..b9a0c022cc7b 100644 --- a/packages/devextreme/js/localization/messages/ca.json +++ b/packages/devextreme/js/localization/messages/ca.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Mostrar recursos", "dxGantt-showDependencies": "Mostrar dependències", "dxGantt-dialogStartDateValidation": "La data d'inici ha de ser després de {0}", - "dxGantt-dialogEndDateValidation": "La data de finalització ha de ser després de {0}" + "dxGantt-dialogEndDateValidation": "La data de finalització ha de ser després de {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/cs.json b/packages/devextreme/js/localization/messages/cs.json index 40c59e2ea0c6..374e4e46c00c 100644 --- a/packages/devextreme/js/localization/messages/cs.json +++ b/packages/devextreme/js/localization/messages/cs.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/de.json b/packages/devextreme/js/localization/messages/de.json index f4a527601a4a..6c5d653e2da3 100644 --- a/packages/devextreme/js/localization/messages/de.json +++ b/packages/devextreme/js/localization/messages/de.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Ressourcen Anzeigen", "dxGantt-showDependencies": "Abhängigkeiten Anzeigen", "dxGantt-dialogStartDateValidation": "Startdatum muss später sein als {0}", - "dxGantt-dialogEndDateValidation": "Enddatum muss später sein als {0}" + "dxGantt-dialogEndDateValidation": "Enddatum muss später sein als {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/el.json b/packages/devextreme/js/localization/messages/el.json index e8d10722e0b7..3e2e25d1922e 100644 --- a/packages/devextreme/js/localization/messages/el.json +++ b/packages/devextreme/js/localization/messages/el.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/en.json b/packages/devextreme/js/localization/messages/en.json index c6761406522b..e1379a00b169 100644 --- a/packages/devextreme/js/localization/messages/en.json +++ b/packages/devextreme/js/localization/messages/en.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/es.json b/packages/devextreme/js/localization/messages/es.json index 3d415df1a196..58b01465ac8e 100644 --- a/packages/devextreme/js/localization/messages/es.json +++ b/packages/devextreme/js/localization/messages/es.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Mostrar Recursos", "dxGantt-showDependencies": "Mostrar Dependencias", "dxGantt-dialogStartDateValidation": "La fecha de inicio debe ser anterior {0}", - "dxGantt-dialogEndDateValidation": "La fecha de finalización debe ser posterior {0}" + "dxGantt-dialogEndDateValidation": "La fecha de finalización debe ser posterior {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/fa.json b/packages/devextreme/js/localization/messages/fa.json index dd80657ea18d..062867c3f6f9 100644 --- a/packages/devextreme/js/localization/messages/fa.json +++ b/packages/devextreme/js/localization/messages/fa.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/fi.json b/packages/devextreme/js/localization/messages/fi.json index 742721e72c6f..b9b14d766be3 100644 --- a/packages/devextreme/js/localization/messages/fi.json +++ b/packages/devextreme/js/localization/messages/fi.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/fr.json b/packages/devextreme/js/localization/messages/fr.json index 91e7e1704108..53304e9369e8 100644 --- a/packages/devextreme/js/localization/messages/fr.json +++ b/packages/devextreme/js/localization/messages/fr.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Afficher les ressources", "dxGantt-showDependencies": "Afficher les dépendances", "dxGantt-dialogStartDateValidation": "La date de début doit être postérieure au {0}", - "dxGantt-dialogEndDateValidation": "La date de fin doit être postérieure au {0}" + "dxGantt-dialogEndDateValidation": "La date de fin doit être postérieure au {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/hu.json b/packages/devextreme/js/localization/messages/hu.json index 3584f4892bcf..2bc2a5155bee 100644 --- a/packages/devextreme/js/localization/messages/hu.json +++ b/packages/devextreme/js/localization/messages/hu.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/it.json b/packages/devextreme/js/localization/messages/it.json index b0b03590e307..1b85de140014 100644 --- a/packages/devextreme/js/localization/messages/it.json +++ b/packages/devextreme/js/localization/messages/it.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/ja.json b/packages/devextreme/js/localization/messages/ja.json index 1719d874f82d..9ac58c026b5e 100644 --- a/packages/devextreme/js/localization/messages/ja.json +++ b/packages/devextreme/js/localization/messages/ja.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "リソースを表示", "dxGantt-showDependencies": "依存関係を表示", "dxGantt-dialogStartDateValidation": "開始日を {0} 以降にする必要があります", - "dxGantt-dialogEndDateValidation": "終了日は {0} より後にする必要があります" + "dxGantt-dialogEndDateValidation": "終了日は {0} より後にする必要があります", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/lt.json b/packages/devextreme/js/localization/messages/lt.json index f4e72af24990..6c7c8f5a905a 100644 --- a/packages/devextreme/js/localization/messages/lt.json +++ b/packages/devextreme/js/localization/messages/lt.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Rodyti resursus", "dxGantt-showDependencies": "Rodyti priklausomybes", "dxGantt-dialogStartDateValidation": "Pradžios data turi būti po {0}", - "dxGantt-dialogEndDateValidation": "Pabaigos data turi būti po {0}" + "dxGantt-dialogEndDateValidation": "Pabaigos data turi būti po {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/lv.json b/packages/devextreme/js/localization/messages/lv.json index c2cba660d6fd..b3392895de3e 100644 --- a/packages/devextreme/js/localization/messages/lv.json +++ b/packages/devextreme/js/localization/messages/lv.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Rādīt Resursus", "dxGantt-showDependencies": "Rādīt Sasaistes", "dxGantt-dialogStartDateValidation": "Sākuma datumam jābūt vēlākam par {0}", - "dxGantt-dialogEndDateValidation": "Beigu datumam jābūt vēlākam par {0}" + "dxGantt-dialogEndDateValidation": "Beigu datumam jābūt vēlākam par {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/nb.json b/packages/devextreme/js/localization/messages/nb.json index 86fd87d68090..380972e40d51 100644 --- a/packages/devextreme/js/localization/messages/nb.json +++ b/packages/devextreme/js/localization/messages/nb.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/nl.json b/packages/devextreme/js/localization/messages/nl.json index d488ffd3f819..264ba0912e8e 100644 --- a/packages/devextreme/js/localization/messages/nl.json +++ b/packages/devextreme/js/localization/messages/nl.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/pt.json b/packages/devextreme/js/localization/messages/pt.json index 5bf2da370201..244c3459a9fa 100644 --- a/packages/devextreme/js/localization/messages/pt.json +++ b/packages/devextreme/js/localization/messages/pt.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Mostrar recursos", "dxGantt-showDependencies": "Mostrar dependências", "dxGantt-dialogStartDateValidation": "A data de início deve ser após {0}", - "dxGantt-dialogEndDateValidation": "A data de término deve ser posterior a {0}" + "dxGantt-dialogEndDateValidation": "A data de término deve ser posterior a {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/ro.json b/packages/devextreme/js/localization/messages/ro.json index 8a9e791e948e..f4e98348529a 100644 --- a/packages/devextreme/js/localization/messages/ro.json +++ b/packages/devextreme/js/localization/messages/ro.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/ru.json b/packages/devextreme/js/localization/messages/ru.json index 1c9b43bc855f..1e7884077884 100644 --- a/packages/devextreme/js/localization/messages/ru.json +++ b/packages/devextreme/js/localization/messages/ru.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Отображать Ресурсы", "dxGantt-showDependencies": "Отображать Зависимости", "dxGantt-dialogStartDateValidation": "Начальная дата должна быть позднее {0}", - "dxGantt-dialogEndDateValidation": "Конечная дата должна быть позднее {0}" + "dxGantt-dialogEndDateValidation": "Конечная дата должна быть позднее {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/sl.json b/packages/devextreme/js/localization/messages/sl.json index 827c07d089e6..bec79140899e 100644 --- a/packages/devextreme/js/localization/messages/sl.json +++ b/packages/devextreme/js/localization/messages/sl.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/sv.json b/packages/devextreme/js/localization/messages/sv.json index 67f54adc4b0d..7ab15af41a0e 100644 --- a/packages/devextreme/js/localization/messages/sv.json +++ b/packages/devextreme/js/localization/messages/sv.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/tr.json b/packages/devextreme/js/localization/messages/tr.json index 0b65cf6384b3..0a2e96eaa71c 100644 --- a/packages/devextreme/js/localization/messages/tr.json +++ b/packages/devextreme/js/localization/messages/tr.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/vi.json b/packages/devextreme/js/localization/messages/vi.json index e3cd9f59bbdd..cfcd5e20337b 100644 --- a/packages/devextreme/js/localization/messages/vi.json +++ b/packages/devextreme/js/localization/messages/vi.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/zh-tw.json b/packages/devextreme/js/localization/messages/zh-tw.json index f27ab174ed71..9301b5e0fbc3 100644 --- a/packages/devextreme/js/localization/messages/zh-tw.json +++ b/packages/devextreme/js/localization/messages/zh-tw.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/zh.json b/packages/devextreme/js/localization/messages/zh.json index 22864685ef8f..99004598f52f 100644 --- a/packages/devextreme/js/localization/messages/zh.json +++ b/packages/devextreme/js/localization/messages/zh.json @@ -699,6 +699,8 @@ "dxGantt-showResources": "Show Resources", "dxGantt-showDependencies": "Show Dependencies", "dxGantt-dialogStartDateValidation": "Start date must be after {0}", - "dxGantt-dialogEndDateValidation": "End date must be after {0}" + "dxGantt-dialogEndDateValidation": "End date must be after {0}", + + "dxGalley-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/ui/gallery.js b/packages/devextreme/js/ui/gallery.js index 12dd02e39465..178577003afd 100644 --- a/packages/devextreme/js/ui/gallery.js +++ b/packages/devextreme/js/ui/gallery.js @@ -18,6 +18,7 @@ import Swipeable from '../events/gesture/swipeable'; import { BindableTemplate } from '../core/templates/bindable_template'; import { Deferred } from '../core/utils/deferred'; import { triggerResizeEvent } from '../events/visibility_change'; +import messageLocalization from '../localization/message'; // STYLE gallery @@ -148,7 +149,7 @@ const Gallery = CollectionWidget.inherit({ _itemAttributes: { role: 'option', - 'aria-label': 'gallery item' + 'aria-label': messageLocalization.format('dxGalley-galleryItemName') }, loopItemFocus: false, selectOnFocus: true, diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js index dcea1ead8c34..0ad57a7d3d22 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.markup.tests.js @@ -89,7 +89,7 @@ QUnit.module('aria accessibility', () => { const $item = $gallery.find(`.${GALLERY_ITEM_CLASS}`); - assert.strictEqual($item.attr('aria-label'), 'gallery item', 'item should have "aria-label"'); + assert.strictEqual($item.attr('aria-label'), 'Gallery item', 'item should have "aria-label"'); }); QUnit.test('aria role for items', function(assert) { From 73e9032d7ab581349147a8a43dd1efd3440eb832 Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Thu, 14 Sep 2023 18:32:53 +0400 Subject: [PATCH 09/16] rework testcafe test --- .../testcafe/tests/gallery/accessibility.ts | 106 +++++++++++------- 1 file changed, 66 insertions(+), 40 deletions(-) diff --git a/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts b/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts index ac94471f3c47..7f4e15ba3eca 100644 --- a/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts +++ b/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts @@ -6,45 +6,71 @@ import { a11yCheck } from '../../helpers/accessibilityUtils'; fixture.disablePageReloads`Gallery` .page(url(__dirname, '../../container.html')); -function getGallerySettings(settings) { - const items = [{ - ID: '1', - Name: 'First', - }, - { - ID: '2', - Name: 'Second', - }]; - - return { - items, - height: 100, - loop: true, - itemTemplate(item) { - const result = document.createElement('div'); - const span = document.createElement('span'); - - span.innerText = item.name; - result.appendChild(span); - - return result; - }, - ...settings, - }; +interface GalleryItem { + ID: string; + Name: string; } -test('Checking Gallery via aXe when width was not set', async (t) => { - await a11yCheck(t); -}).before(async () => createWidget( - 'dxGallery', - getGallerySettings({}), -)); - -test('Checking Gallery via aXe when width was set', async (t) => { - await a11yCheck(t); -}).before(async () => createWidget( - 'dxGallery', - getGallerySettings({ - width: '100%', - }), -)); +const defaultItems: GalleryItem[] = [{ + ID: '1', + Name: 'First', +}, +{ + ID: '2', + Name: 'Second', +}]; + +function defaultItemTemplate(item: GalleryItem) { + const result = document.createElement('div'); + const span = document.createElement('span'); + + span.innerText = item.Name; + result.appendChild(span); + + return result; +} + +function getTestName(gallerySettings) { + const messageParts: string[] = []; + const fields = ['items', 'width', 'itemTemplate']; + + fields.forEach((field) => { + const fieldSkipped = gallerySettings[field] === undefined; + + messageParts.push(`${field} was ${fieldSkipped ? 'not' : ''} set`); + }); + + return `Checking Gallery via aXe. Settings: ${messageParts.join(', ')}`; +} + +const gallerySettings = [{}, { + items: defaultItems, +}, { + itemTemplate: defaultItemTemplate, +}, { + width: '100%', +}, { + loop: true, +}, { + showIndicator: false, +}].reduce((acc: any, currentValue, index, arr) => { + acc.push({ + ...currentValue, + ...arr[index - 1], + }); + return acc; +}, []); + +const testsSettings = gallerySettings.map((settings) => ({ + testName: getTestName(settings), + gallerySettings: settings, +})); + +testsSettings.forEach((settings) => { + test(settings.testName, async (t) => { + await a11yCheck(t); + }).before(async () => createWidget( + 'dxGallery', + gallerySettings, + )); +}); From a93faf204622fcc49a106bbc49e8667ee0ff0b03 Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Thu, 14 Sep 2023 18:54:43 +0400 Subject: [PATCH 10/16] test fixes --- .../devextreme/testing/testcafe/tests/gallery/accessibility.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts b/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts index 7f4e15ba3eca..e5c647e87bd3 100644 --- a/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts +++ b/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts @@ -32,7 +32,7 @@ function defaultItemTemplate(item: GalleryItem) { function getTestName(gallerySettings) { const messageParts: string[] = []; - const fields = ['items', 'width', 'itemTemplate']; + const fields = Object.keys(gallerySettings); fields.forEach((field) => { const fieldSkipped = gallerySettings[field] === undefined; From 92ff2a185d70414dd21122bbde48ed325b262549 Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Fri, 15 Sep 2023 13:06:55 +0400 Subject: [PATCH 11/16] test refactor --- .../testing/testcafe/tests/gallery/accessibility.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts b/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts index e5c647e87bd3..970fab1bb992 100644 --- a/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts +++ b/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts @@ -31,13 +31,12 @@ function defaultItemTemplate(item: GalleryItem) { } function getTestName(gallerySettings) { - const messageParts: string[] = []; const fields = Object.keys(gallerySettings); - fields.forEach((field) => { + const messageParts = fields.map((field) => { const fieldSkipped = gallerySettings[field] === undefined; - messageParts.push(`${field} was ${fieldSkipped ? 'not' : ''} set`); + return `${field} was ${fieldSkipped ? 'not' : ''} set`; }); return `Checking Gallery via aXe. Settings: ${messageParts.join(', ')}`; @@ -61,7 +60,10 @@ const gallerySettings = [{}, { return acc; }, []); -const testsSettings = gallerySettings.map((settings) => ({ +const testsSettings: { + testName: string; + gallerySettings: any; +}[] = gallerySettings.map((settings) => ({ testName: getTestName(settings), gallerySettings: settings, })); @@ -71,6 +73,6 @@ testsSettings.forEach((settings) => { await a11yCheck(t); }).before(async () => createWidget( 'dxGallery', - gallerySettings, + settings.gallerySettings, )); }); From 69f8a9f8aaf48216fd35ffc84baccc081870a6e9 Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Tue, 26 Sep 2023 10:57:16 +0400 Subject: [PATCH 12/16] fix typo & renames --- packages/devextreme/js/localization/messages/ar.json | 2 +- packages/devextreme/js/localization/messages/ca.json | 2 +- packages/devextreme/js/localization/messages/cs.json | 2 +- packages/devextreme/js/localization/messages/de.json | 2 +- packages/devextreme/js/localization/messages/el.json | 2 +- packages/devextreme/js/localization/messages/en.json | 2 +- packages/devextreme/js/localization/messages/es.json | 2 +- packages/devextreme/js/localization/messages/fa.json | 2 +- packages/devextreme/js/localization/messages/fi.json | 2 +- packages/devextreme/js/localization/messages/fr.json | 2 +- packages/devextreme/js/localization/messages/hu.json | 2 +- packages/devextreme/js/localization/messages/it.json | 2 +- packages/devextreme/js/localization/messages/ja.json | 2 +- packages/devextreme/js/localization/messages/lt.json | 2 +- packages/devextreme/js/localization/messages/lv.json | 2 +- packages/devextreme/js/localization/messages/nb.json | 2 +- packages/devextreme/js/localization/messages/nl.json | 2 +- packages/devextreme/js/localization/messages/pt.json | 2 +- packages/devextreme/js/localization/messages/ro.json | 2 +- packages/devextreme/js/localization/messages/ru.json | 2 +- packages/devextreme/js/localization/messages/sl.json | 2 +- packages/devextreme/js/localization/messages/sv.json | 2 +- packages/devextreme/js/localization/messages/tr.json | 2 +- packages/devextreme/js/localization/messages/vi.json | 2 +- packages/devextreme/js/localization/messages/zh-tw.json | 2 +- packages/devextreme/js/localization/messages/zh.json | 2 +- packages/devextreme/js/ui/gallery.js | 6 +++--- 27 files changed, 29 insertions(+), 29 deletions(-) diff --git a/packages/devextreme/js/localization/messages/ar.json b/packages/devextreme/js/localization/messages/ar.json index 1c09c531f97b..5137445240ff 100644 --- a/packages/devextreme/js/localization/messages/ar.json +++ b/packages/devextreme/js/localization/messages/ar.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/ca.json b/packages/devextreme/js/localization/messages/ca.json index b9a0c022cc7b..4643e94b1889 100644 --- a/packages/devextreme/js/localization/messages/ca.json +++ b/packages/devextreme/js/localization/messages/ca.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "La data d'inici ha de ser després de {0}", "dxGantt-dialogEndDateValidation": "La data de finalització ha de ser després de {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/cs.json b/packages/devextreme/js/localization/messages/cs.json index 374e4e46c00c..4a9f75aea9b1 100644 --- a/packages/devextreme/js/localization/messages/cs.json +++ b/packages/devextreme/js/localization/messages/cs.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/de.json b/packages/devextreme/js/localization/messages/de.json index 6c5d653e2da3..a4dcaa6f98e6 100644 --- a/packages/devextreme/js/localization/messages/de.json +++ b/packages/devextreme/js/localization/messages/de.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Startdatum muss später sein als {0}", "dxGantt-dialogEndDateValidation": "Enddatum muss später sein als {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/el.json b/packages/devextreme/js/localization/messages/el.json index 3e2e25d1922e..369425faa2c3 100644 --- a/packages/devextreme/js/localization/messages/el.json +++ b/packages/devextreme/js/localization/messages/el.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/en.json b/packages/devextreme/js/localization/messages/en.json index e1379a00b169..e35d484e77e0 100644 --- a/packages/devextreme/js/localization/messages/en.json +++ b/packages/devextreme/js/localization/messages/en.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/es.json b/packages/devextreme/js/localization/messages/es.json index 58b01465ac8e..4317d59ca54e 100644 --- a/packages/devextreme/js/localization/messages/es.json +++ b/packages/devextreme/js/localization/messages/es.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "La fecha de inicio debe ser anterior {0}", "dxGantt-dialogEndDateValidation": "La fecha de finalización debe ser posterior {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/fa.json b/packages/devextreme/js/localization/messages/fa.json index 062867c3f6f9..9be8bd765d8d 100644 --- a/packages/devextreme/js/localization/messages/fa.json +++ b/packages/devextreme/js/localization/messages/fa.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/fi.json b/packages/devextreme/js/localization/messages/fi.json index b9b14d766be3..ace4c4104cd5 100644 --- a/packages/devextreme/js/localization/messages/fi.json +++ b/packages/devextreme/js/localization/messages/fi.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/fr.json b/packages/devextreme/js/localization/messages/fr.json index 53304e9369e8..447771a63946 100644 --- a/packages/devextreme/js/localization/messages/fr.json +++ b/packages/devextreme/js/localization/messages/fr.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "La date de début doit être postérieure au {0}", "dxGantt-dialogEndDateValidation": "La date de fin doit être postérieure au {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/hu.json b/packages/devextreme/js/localization/messages/hu.json index 2bc2a5155bee..a35053477710 100644 --- a/packages/devextreme/js/localization/messages/hu.json +++ b/packages/devextreme/js/localization/messages/hu.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/it.json b/packages/devextreme/js/localization/messages/it.json index 1b85de140014..b003fbf4b8f5 100644 --- a/packages/devextreme/js/localization/messages/it.json +++ b/packages/devextreme/js/localization/messages/it.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/ja.json b/packages/devextreme/js/localization/messages/ja.json index 9ac58c026b5e..c964bc4a67ad 100644 --- a/packages/devextreme/js/localization/messages/ja.json +++ b/packages/devextreme/js/localization/messages/ja.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "開始日を {0} 以降にする必要があります", "dxGantt-dialogEndDateValidation": "終了日は {0} より後にする必要があります", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/lt.json b/packages/devextreme/js/localization/messages/lt.json index 6c7c8f5a905a..9a15403f0f04 100644 --- a/packages/devextreme/js/localization/messages/lt.json +++ b/packages/devextreme/js/localization/messages/lt.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Pradžios data turi būti po {0}", "dxGantt-dialogEndDateValidation": "Pabaigos data turi būti po {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/lv.json b/packages/devextreme/js/localization/messages/lv.json index b3392895de3e..b6fe62fe0346 100644 --- a/packages/devextreme/js/localization/messages/lv.json +++ b/packages/devextreme/js/localization/messages/lv.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Sākuma datumam jābūt vēlākam par {0}", "dxGantt-dialogEndDateValidation": "Beigu datumam jābūt vēlākam par {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/nb.json b/packages/devextreme/js/localization/messages/nb.json index 380972e40d51..accb938d08e1 100644 --- a/packages/devextreme/js/localization/messages/nb.json +++ b/packages/devextreme/js/localization/messages/nb.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/nl.json b/packages/devextreme/js/localization/messages/nl.json index 264ba0912e8e..922dde24abca 100644 --- a/packages/devextreme/js/localization/messages/nl.json +++ b/packages/devextreme/js/localization/messages/nl.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/pt.json b/packages/devextreme/js/localization/messages/pt.json index 244c3459a9fa..5fadb61a7596 100644 --- a/packages/devextreme/js/localization/messages/pt.json +++ b/packages/devextreme/js/localization/messages/pt.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "A data de início deve ser após {0}", "dxGantt-dialogEndDateValidation": "A data de término deve ser posterior a {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/ro.json b/packages/devextreme/js/localization/messages/ro.json index f4e98348529a..b6c1b8ea8699 100644 --- a/packages/devextreme/js/localization/messages/ro.json +++ b/packages/devextreme/js/localization/messages/ro.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/ru.json b/packages/devextreme/js/localization/messages/ru.json index 1e7884077884..5d6a245cd402 100644 --- a/packages/devextreme/js/localization/messages/ru.json +++ b/packages/devextreme/js/localization/messages/ru.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Начальная дата должна быть позднее {0}", "dxGantt-dialogEndDateValidation": "Конечная дата должна быть позднее {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/sl.json b/packages/devextreme/js/localization/messages/sl.json index bec79140899e..e0c65da74b2e 100644 --- a/packages/devextreme/js/localization/messages/sl.json +++ b/packages/devextreme/js/localization/messages/sl.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/sv.json b/packages/devextreme/js/localization/messages/sv.json index 7ab15af41a0e..58bccb0e58e7 100644 --- a/packages/devextreme/js/localization/messages/sv.json +++ b/packages/devextreme/js/localization/messages/sv.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/tr.json b/packages/devextreme/js/localization/messages/tr.json index 0a2e96eaa71c..618329f37ede 100644 --- a/packages/devextreme/js/localization/messages/tr.json +++ b/packages/devextreme/js/localization/messages/tr.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/vi.json b/packages/devextreme/js/localization/messages/vi.json index cfcd5e20337b..2f1c3e73dbca 100644 --- a/packages/devextreme/js/localization/messages/vi.json +++ b/packages/devextreme/js/localization/messages/vi.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/zh-tw.json b/packages/devextreme/js/localization/messages/zh-tw.json index 9301b5e0fbc3..d1acd087e55e 100644 --- a/packages/devextreme/js/localization/messages/zh-tw.json +++ b/packages/devextreme/js/localization/messages/zh-tw.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/zh.json b/packages/devextreme/js/localization/messages/zh.json index 99004598f52f..7719dc0000ca 100644 --- a/packages/devextreme/js/localization/messages/zh.json +++ b/packages/devextreme/js/localization/messages/zh.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGalley-galleryItemName": "Gallery item" + "dxGallery-galleryItemName": "Gallery item" } } diff --git a/packages/devextreme/js/ui/gallery.js b/packages/devextreme/js/ui/gallery.js index 178577003afd..32eaa4767189 100644 --- a/packages/devextreme/js/ui/gallery.js +++ b/packages/devextreme/js/ui/gallery.js @@ -149,7 +149,7 @@ const Gallery = CollectionWidget.inherit({ _itemAttributes: { role: 'option', - 'aria-label': messageLocalization.format('dxGalley-galleryItemName') + 'aria-label': messageLocalization.format('dxGallery-galleryItemName') }, loopItemFocus: false, selectOnFocus: true, @@ -277,9 +277,9 @@ const Gallery = CollectionWidget.inherit({ this.callBase(); - const listBoxRoleShouldBe = this._itemsCount() > 0; + const useListBoxRole = this._itemsCount() > 0; const ariaAttrs = { - 'role': listBoxRoleShouldBe ? 'listbox' : undefined, + 'role': useListBoxRole ? 'listbox' : undefined, 'label': 'gallery' }; From b9f4387bd191fa1561a87fea1d2a5a2c29ec876b Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Tue, 26 Sep 2023 11:41:47 +0400 Subject: [PATCH 13/16] make test as should be --- .../testing/testcafe/tests/gallery/accessibility.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts b/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts index 970fab1bb992..f3fb5375afd3 100644 --- a/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts +++ b/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts @@ -52,10 +52,10 @@ const gallerySettings = [{}, { loop: true, }, { showIndicator: false, -}].reduce((acc: any, currentValue, index, arr) => { +}].reduce((acc: any, currentValue) => { acc.push({ ...currentValue, - ...arr[index - 1], + ...acc.at(-1), }); return acc; }, []); From d75f291af3a9f943a14d9058e8e5f43fa7242a17 Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Wed, 27 Sep 2023 12:42:02 +0400 Subject: [PATCH 14/16] rename localization message --- packages/devextreme/js/localization/messages/ar.json | 2 +- packages/devextreme/js/localization/messages/ca.json | 2 +- packages/devextreme/js/localization/messages/cs.json | 2 +- packages/devextreme/js/localization/messages/de.json | 2 +- packages/devextreme/js/localization/messages/el.json | 2 +- packages/devextreme/js/localization/messages/en.json | 2 +- packages/devextreme/js/localization/messages/es.json | 2 +- packages/devextreme/js/localization/messages/fa.json | 2 +- packages/devextreme/js/localization/messages/fi.json | 2 +- packages/devextreme/js/localization/messages/fr.json | 2 +- packages/devextreme/js/localization/messages/hu.json | 2 +- packages/devextreme/js/localization/messages/it.json | 2 +- packages/devextreme/js/localization/messages/ja.json | 2 +- packages/devextreme/js/localization/messages/lt.json | 2 +- packages/devextreme/js/localization/messages/lv.json | 2 +- packages/devextreme/js/localization/messages/nb.json | 2 +- packages/devextreme/js/localization/messages/nl.json | 2 +- packages/devextreme/js/localization/messages/pt.json | 2 +- packages/devextreme/js/localization/messages/ro.json | 2 +- packages/devextreme/js/localization/messages/ru.json | 2 +- packages/devextreme/js/localization/messages/sl.json | 2 +- packages/devextreme/js/localization/messages/sv.json | 2 +- packages/devextreme/js/localization/messages/tr.json | 2 +- packages/devextreme/js/localization/messages/vi.json | 2 +- packages/devextreme/js/localization/messages/zh-tw.json | 2 +- packages/devextreme/js/localization/messages/zh.json | 2 +- packages/devextreme/js/ui/gallery.js | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/devextreme/js/localization/messages/ar.json b/packages/devextreme/js/localization/messages/ar.json index 5137445240ff..c77be62a076a 100644 --- a/packages/devextreme/js/localization/messages/ar.json +++ b/packages/devextreme/js/localization/messages/ar.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/ca.json b/packages/devextreme/js/localization/messages/ca.json index 4643e94b1889..8a9b9e8f76a5 100644 --- a/packages/devextreme/js/localization/messages/ca.json +++ b/packages/devextreme/js/localization/messages/ca.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "La data d'inici ha de ser després de {0}", "dxGantt-dialogEndDateValidation": "La data de finalització ha de ser després de {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/cs.json b/packages/devextreme/js/localization/messages/cs.json index 4a9f75aea9b1..dc056ce96c2e 100644 --- a/packages/devextreme/js/localization/messages/cs.json +++ b/packages/devextreme/js/localization/messages/cs.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/de.json b/packages/devextreme/js/localization/messages/de.json index a4dcaa6f98e6..6a7e0603c324 100644 --- a/packages/devextreme/js/localization/messages/de.json +++ b/packages/devextreme/js/localization/messages/de.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Startdatum muss später sein als {0}", "dxGantt-dialogEndDateValidation": "Enddatum muss später sein als {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/el.json b/packages/devextreme/js/localization/messages/el.json index 369425faa2c3..4118f37a596a 100644 --- a/packages/devextreme/js/localization/messages/el.json +++ b/packages/devextreme/js/localization/messages/el.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/en.json b/packages/devextreme/js/localization/messages/en.json index e35d484e77e0..29db914d31b5 100644 --- a/packages/devextreme/js/localization/messages/en.json +++ b/packages/devextreme/js/localization/messages/en.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/es.json b/packages/devextreme/js/localization/messages/es.json index 4317d59ca54e..4e5899b24e25 100644 --- a/packages/devextreme/js/localization/messages/es.json +++ b/packages/devextreme/js/localization/messages/es.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "La fecha de inicio debe ser anterior {0}", "dxGantt-dialogEndDateValidation": "La fecha de finalización debe ser posterior {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/fa.json b/packages/devextreme/js/localization/messages/fa.json index 9be8bd765d8d..fd867af2c09e 100644 --- a/packages/devextreme/js/localization/messages/fa.json +++ b/packages/devextreme/js/localization/messages/fa.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/fi.json b/packages/devextreme/js/localization/messages/fi.json index ace4c4104cd5..fd3665c829b1 100644 --- a/packages/devextreme/js/localization/messages/fi.json +++ b/packages/devextreme/js/localization/messages/fi.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/fr.json b/packages/devextreme/js/localization/messages/fr.json index 447771a63946..523354c42440 100644 --- a/packages/devextreme/js/localization/messages/fr.json +++ b/packages/devextreme/js/localization/messages/fr.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "La date de début doit être postérieure au {0}", "dxGantt-dialogEndDateValidation": "La date de fin doit être postérieure au {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/hu.json b/packages/devextreme/js/localization/messages/hu.json index a35053477710..d37025db09b0 100644 --- a/packages/devextreme/js/localization/messages/hu.json +++ b/packages/devextreme/js/localization/messages/hu.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/it.json b/packages/devextreme/js/localization/messages/it.json index b003fbf4b8f5..a597b0aae7b4 100644 --- a/packages/devextreme/js/localization/messages/it.json +++ b/packages/devextreme/js/localization/messages/it.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/ja.json b/packages/devextreme/js/localization/messages/ja.json index c964bc4a67ad..6df19f5e8284 100644 --- a/packages/devextreme/js/localization/messages/ja.json +++ b/packages/devextreme/js/localization/messages/ja.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "開始日を {0} 以降にする必要があります", "dxGantt-dialogEndDateValidation": "終了日は {0} より後にする必要があります", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/lt.json b/packages/devextreme/js/localization/messages/lt.json index 9a15403f0f04..15b23b257ffb 100644 --- a/packages/devextreme/js/localization/messages/lt.json +++ b/packages/devextreme/js/localization/messages/lt.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Pradžios data turi būti po {0}", "dxGantt-dialogEndDateValidation": "Pabaigos data turi būti po {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/lv.json b/packages/devextreme/js/localization/messages/lv.json index b6fe62fe0346..c5fe387e529d 100644 --- a/packages/devextreme/js/localization/messages/lv.json +++ b/packages/devextreme/js/localization/messages/lv.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Sākuma datumam jābūt vēlākam par {0}", "dxGantt-dialogEndDateValidation": "Beigu datumam jābūt vēlākam par {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/nb.json b/packages/devextreme/js/localization/messages/nb.json index accb938d08e1..f9908a6527e9 100644 --- a/packages/devextreme/js/localization/messages/nb.json +++ b/packages/devextreme/js/localization/messages/nb.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/nl.json b/packages/devextreme/js/localization/messages/nl.json index 922dde24abca..803936cc1fd9 100644 --- a/packages/devextreme/js/localization/messages/nl.json +++ b/packages/devextreme/js/localization/messages/nl.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/pt.json b/packages/devextreme/js/localization/messages/pt.json index 5fadb61a7596..258fbea90e09 100644 --- a/packages/devextreme/js/localization/messages/pt.json +++ b/packages/devextreme/js/localization/messages/pt.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "A data de início deve ser após {0}", "dxGantt-dialogEndDateValidation": "A data de término deve ser posterior a {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/ro.json b/packages/devextreme/js/localization/messages/ro.json index b6c1b8ea8699..837a326eb09a 100644 --- a/packages/devextreme/js/localization/messages/ro.json +++ b/packages/devextreme/js/localization/messages/ro.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/ru.json b/packages/devextreme/js/localization/messages/ru.json index 5d6a245cd402..287afa9d1388 100644 --- a/packages/devextreme/js/localization/messages/ru.json +++ b/packages/devextreme/js/localization/messages/ru.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Начальная дата должна быть позднее {0}", "dxGantt-dialogEndDateValidation": "Конечная дата должна быть позднее {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/sl.json b/packages/devextreme/js/localization/messages/sl.json index e0c65da74b2e..5a692617ba83 100644 --- a/packages/devextreme/js/localization/messages/sl.json +++ b/packages/devextreme/js/localization/messages/sl.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/sv.json b/packages/devextreme/js/localization/messages/sv.json index 58bccb0e58e7..752b5e0808e4 100644 --- a/packages/devextreme/js/localization/messages/sv.json +++ b/packages/devextreme/js/localization/messages/sv.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/tr.json b/packages/devextreme/js/localization/messages/tr.json index 618329f37ede..fcb0ec4d70a3 100644 --- a/packages/devextreme/js/localization/messages/tr.json +++ b/packages/devextreme/js/localization/messages/tr.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/vi.json b/packages/devextreme/js/localization/messages/vi.json index 2f1c3e73dbca..f183d174067b 100644 --- a/packages/devextreme/js/localization/messages/vi.json +++ b/packages/devextreme/js/localization/messages/vi.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/zh-tw.json b/packages/devextreme/js/localization/messages/zh-tw.json index d1acd087e55e..64e670108644 100644 --- a/packages/devextreme/js/localization/messages/zh-tw.json +++ b/packages/devextreme/js/localization/messages/zh-tw.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/localization/messages/zh.json b/packages/devextreme/js/localization/messages/zh.json index 7719dc0000ca..6152ddbc0d43 100644 --- a/packages/devextreme/js/localization/messages/zh.json +++ b/packages/devextreme/js/localization/messages/zh.json @@ -701,6 +701,6 @@ "dxGantt-dialogStartDateValidation": "Start date must be after {0}", "dxGantt-dialogEndDateValidation": "End date must be after {0}", - "dxGallery-galleryItemName": "Gallery item" + "dxGallery-itemName": "Gallery item" } } diff --git a/packages/devextreme/js/ui/gallery.js b/packages/devextreme/js/ui/gallery.js index 32eaa4767189..af0446f0b560 100644 --- a/packages/devextreme/js/ui/gallery.js +++ b/packages/devextreme/js/ui/gallery.js @@ -149,7 +149,7 @@ const Gallery = CollectionWidget.inherit({ _itemAttributes: { role: 'option', - 'aria-label': messageLocalization.format('dxGallery-galleryItemName') + 'aria-label': messageLocalization.format('dxGallery-itemName') }, loopItemFocus: false, selectOnFocus: true, From a8898aadda6f45d9b634d11b7520b5c1b35daf76 Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Wed, 27 Sep 2023 12:43:28 +0400 Subject: [PATCH 15/16] renames --- .../testing/tests/DevExpress.ui.widgets/gallery.tests.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js index cf6a17df8e70..8a32f4319dd5 100644 --- a/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js +++ b/packages/devextreme/testing/tests/DevExpress.ui.widgets/gallery.tests.js @@ -2764,7 +2764,7 @@ QUnit.module('accessibility', function() { }); }); - QUnit.test('aria-activedescendant should have link to one element only', function(assert) { + QUnit.test('aria-activedescendant should have link to the single element', function(assert) { const $gallery = $('#gallerySimple').dxGallery({ height: 100, width: '100%', @@ -2782,7 +2782,7 @@ QUnit.module('accessibility', function() { assert.strictEqual(itemsWithId.length, 1, 'id attribute should be exist only on one item'); }); - QUnit.test('aria-activedescendant should have link to one element only after resize', function(assert) { + QUnit.test('aria-activedescendant should have link to the single element after resize', function(assert) { const $gallery = $('#gallerySimple').dxGallery({ height: 100, showIndicator: false, @@ -2801,5 +2801,4 @@ QUnit.module('accessibility', function() { assert.strictEqual(itemsWithId.length, 1, 'id attribute should be exist only on one item'); }); - }); From bc73dae78ba03a82dc52bb44ab77d08efc543418 Mon Sep 17 00:00:00 2001 From: "alexander.polosatov" Date: Wed, 27 Sep 2023 15:29:44 +0400 Subject: [PATCH 16/16] rework testcafe test --- .../testcafe/tests/gallery/accessibility.ts | 76 +++++++++++-------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts b/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts index f3fb5375afd3..5c711562b127 100644 --- a/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts +++ b/packages/devextreme/testing/testcafe/tests/gallery/accessibility.ts @@ -11,6 +11,14 @@ interface GalleryItem { Name: string; } +interface GallerySettings { + items?: GalleryItem[]; + itemTemplate?: (item: GalleryItem) => HTMLDivElement; + width?: string; + loop?: boolean; + showIndicator?: boolean; +} + const defaultItems: GalleryItem[] = [{ ID: '1', Name: 'First', @@ -30,7 +38,15 @@ function defaultItemTemplate(item: GalleryItem) { return result; } -function getTestName(gallerySettings) { +const allGallerySettings: GallerySettings = { + items: defaultItems, + itemTemplate: defaultItemTemplate, + width: '100%', + loop: true, + showIndicator: false, +}; + +function getTestName(gallerySettings: GallerySettings) { const fields = Object.keys(gallerySettings); const messageParts = fields.map((field) => { @@ -42,37 +58,37 @@ function getTestName(gallerySettings) { return `Checking Gallery via aXe. Settings: ${messageParts.join(', ')}`; } -const gallerySettings = [{}, { - items: defaultItems, -}, { - itemTemplate: defaultItemTemplate, -}, { - width: '100%', -}, { - loop: true, -}, { - showIndicator: false, -}].reduce((acc: any, currentValue) => { - acc.push({ - ...currentValue, - ...acc.at(-1), - }); - return acc; -}, []); - -const testsSettings: { - testName: string; - gallerySettings: any; -}[] = gallerySettings.map((settings) => ({ - testName: getTestName(settings), - gallerySettings: settings, -})); - -testsSettings.forEach((settings) => { - test(settings.testName, async (t) => { +function generateCombinations(allSettings: GallerySettings): GallerySettings[] { + const keys = Object.keys(allSettings); + const combinations: GallerySettings[] = []; + + const generate = (index: number, currentCombination: GallerySettings) => { + if (index === keys.length) { + combinations.push(currentCombination); + return; + } + + const key = keys[index]; + const value = allSettings[key]; + + generate(index + 1, currentCombination); + + const newCombination = { ...currentCombination, [key]: value }; + generate(index + 1, newCombination); + }; + + generate(0, {}); + return combinations; +} + +const settingsCombinations = generateCombinations(allGallerySettings); + +settingsCombinations.forEach((settings) => { + const testName = getTestName(settings); + test(testName, async (t) => { await a11yCheck(t); }).before(async () => createWidget( 'dxGallery', - settings.gallerySettings, + settings, )); });