From adba108f8deb09348ba7d0bf5670a34aa01cb055 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Wed, 23 Sep 2020 16:41:39 +1200 Subject: [PATCH] Create separate test for selection-follows-focus --- cypress/integration/tabbed-carousel.js | 3 +- js/init.js | 2 +- tabbed-carousel.html | 70 ++++++++++++++++++++++---- 3 files changed, 63 insertions(+), 12 deletions(-) diff --git a/cypress/integration/tabbed-carousel.js b/cypress/integration/tabbed-carousel.js index 02f76af..6e86cc4 100644 --- a/cypress/integration/tabbed-carousel.js +++ b/cypress/integration/tabbed-carousel.js @@ -47,7 +47,8 @@ describe('Tabbed Carousel', function () { }); const testIds = [ - 'test-1' + 'test-1', + 'test-2' ]; describe('Tests', function () { diff --git a/js/init.js b/js/init.js index 462ad9c..ecdbe7a 100644 --- a/js/init.js +++ b/js/init.js @@ -33,7 +33,7 @@ document.onreadystatechange = () => { document.querySelectorAll('.tabbed-carousel').forEach((tabbedCarousel) => { const tabbedCarouselInstance = new TabbedCarousel({ instanceElement: tabbedCarousel, - selectionFollowsFocus: true + selectionFollowsFocus: tabbedCarousel.getAttribute('data-selection-follows-focus') }); tabbedCarouselInstance.init(); diff --git a/tabbed-carousel.html b/tabbed-carousel.html index e0b9cc0..d7823d9 100644 --- a/tabbed-carousel.html +++ b/tabbed-carousel.html @@ -11,21 +11,22 @@

Tabbed carousel

See Cypress unit tests for specification.

+

Test 1

-
+

Image 1

Description of photo 1
-