From: Nicolas Coden Date: Thu, 18 Jan 2018 22:38:28 +0000 (+0100) Subject: test: add unit test for Abide.addGlobalErrorA11yAttributes() X-Git-Tag: v6.6.0~3^2~311^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e7fa061412a1eda1b67609d53fec986bd286148;p=thirdparty%2Ffoundation%2Ffoundation-sites.git test: add unit test for Abide.addGlobalErrorA11yAttributes() --- 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 = $(`