From 8e7fa061412a1eda1b67609d53fec986bd286148 Mon Sep 17 00:00:00 2001 From: Nicolas Coden Date: Thu, 18 Jan 2018 23:38:28 +0100 Subject: [PATCH] test: add unit test for Abide.addGlobalErrorA11yAttributes() --- test/javascript/components/abide.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/javascript/components/abide.js b/test/javascript/components/abide.js index f57d92478..bca442048 100644 --- a/test/javascript/components/abide.js +++ b/test/javascript/components/abide.js @@ -92,6 +92,16 @@ describe('Abide', function() { }); }); + describe('addGlobalErrorA11yAttributes()', function () { + it('adds [aria-live] attribute on element', function () { + $html = $(`
`).appendTo('body'); + plugin = new Foundation.Abide($html, { a11yErrorLevel: 'test-level' }); + plugin.addA11yAttributes($html.find('[data-abide-error]')); + + $html.find('[data-abide-error]').should.have.attr('aria-live', 'test-level'); + }); + }); + describe('addA11yAttributes()', function () { it('adds [aria-describedby] attribute to field and [for] attribute to form error', function() { $html = $(` -- 2.47.2