Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
testEndsWith : function () {
this.assertTrue(ariaUtilsString.endsWith("", ""));
this.assertFalse(ariaUtilsString.endsWith("", "a"));
this.assertTrue(ariaUtilsString.endsWith("a", "a"));
this.assertFalse(ariaUtilsString.endsWith("ab", "a"));
this.assertTrue(ariaUtilsString.endsWith("aba", "a"));
this.assertFalse(ariaUtilsString.endsWith("aba", "b"));
this.assertTrue(ariaUtilsString.endsWith("abc", ""));
this.assertTrue(ariaUtilsString.endsWith("abc", "bc"));
this.assertTrue(ariaUtilsString.endsWith("a b", " b"));
this.assertFalse(ariaUtilsString.endsWith("a b", "a"));
},
testEndsWith : function () {
this.assertTrue(ariaUtilsString.endsWith("", ""));
this.assertFalse(ariaUtilsString.endsWith("", "a"));
this.assertTrue(ariaUtilsString.endsWith("a", "a"));
this.assertFalse(ariaUtilsString.endsWith("ab", "a"));
this.assertTrue(ariaUtilsString.endsWith("aba", "a"));
this.assertFalse(ariaUtilsString.endsWith("aba", "b"));
this.assertTrue(ariaUtilsString.endsWith("abc", ""));
this.assertTrue(ariaUtilsString.endsWith("abc", "bc"));
this.assertTrue(ariaUtilsString.endsWith("a b", " b"));
this.assertFalse(ariaUtilsString.endsWith("a b", "a"));
},
testEndsWith : function () {
this.assertTrue(ariaUtilsString.endsWith("", ""));
this.assertFalse(ariaUtilsString.endsWith("", "a"));
this.assertTrue(ariaUtilsString.endsWith("a", "a"));
this.assertFalse(ariaUtilsString.endsWith("ab", "a"));
this.assertTrue(ariaUtilsString.endsWith("aba", "a"));
this.assertFalse(ariaUtilsString.endsWith("aba", "b"));
this.assertTrue(ariaUtilsString.endsWith("abc", ""));
this.assertTrue(ariaUtilsString.endsWith("abc", "bc"));
this.assertTrue(ariaUtilsString.endsWith("a b", " b"));
this.assertFalse(ariaUtilsString.endsWith("a b", "a"));
},
testEndsWith : function () {
this.assertTrue(ariaUtilsString.endsWith("", ""));
this.assertFalse(ariaUtilsString.endsWith("", "a"));
this.assertTrue(ariaUtilsString.endsWith("a", "a"));
this.assertFalse(ariaUtilsString.endsWith("ab", "a"));
this.assertTrue(ariaUtilsString.endsWith("aba", "a"));
this.assertFalse(ariaUtilsString.endsWith("aba", "b"));
this.assertTrue(ariaUtilsString.endsWith("abc", ""));
this.assertTrue(ariaUtilsString.endsWith("abc", "bc"));
this.assertTrue(ariaUtilsString.endsWith("a b", " b"));
this.assertFalse(ariaUtilsString.endsWith("a b", "a"));
},
testEndsWith : function () {
this.assertTrue(ariaUtilsString.endsWith("", ""));
this.assertFalse(ariaUtilsString.endsWith("", "a"));
this.assertTrue(ariaUtilsString.endsWith("a", "a"));
this.assertFalse(ariaUtilsString.endsWith("ab", "a"));
this.assertTrue(ariaUtilsString.endsWith("aba", "a"));
this.assertFalse(ariaUtilsString.endsWith("aba", "b"));
this.assertTrue(ariaUtilsString.endsWith("abc", ""));
this.assertTrue(ariaUtilsString.endsWith("abc", "bc"));
this.assertTrue(ariaUtilsString.endsWith("a b", " b"));
this.assertFalse(ariaUtilsString.endsWith("a b", "a"));
},
testEndsWith : function () {
this.assertTrue(ariaUtilsString.endsWith("", ""));
this.assertFalse(ariaUtilsString.endsWith("", "a"));
this.assertTrue(ariaUtilsString.endsWith("a", "a"));
this.assertFalse(ariaUtilsString.endsWith("ab", "a"));
this.assertTrue(ariaUtilsString.endsWith("aba", "a"));
this.assertFalse(ariaUtilsString.endsWith("aba", "b"));
this.assertTrue(ariaUtilsString.endsWith("abc", ""));
this.assertTrue(ariaUtilsString.endsWith("abc", "bc"));
this.assertTrue(ariaUtilsString.endsWith("a b", " b"));
this.assertFalse(ariaUtilsString.endsWith("a b", "a"));
},
testEndsWith : function () {
this.assertTrue(ariaUtilsString.endsWith("", ""));
this.assertFalse(ariaUtilsString.endsWith("", "a"));
this.assertTrue(ariaUtilsString.endsWith("a", "a"));
this.assertFalse(ariaUtilsString.endsWith("ab", "a"));
this.assertTrue(ariaUtilsString.endsWith("aba", "a"));
this.assertFalse(ariaUtilsString.endsWith("aba", "b"));
this.assertTrue(ariaUtilsString.endsWith("abc", ""));
this.assertTrue(ariaUtilsString.endsWith("abc", "bc"));
this.assertTrue(ariaUtilsString.endsWith("a b", " b"));
this.assertFalse(ariaUtilsString.endsWith("a b", "a"));
},
testEndsWith : function () {
this.assertTrue(ariaUtilsString.endsWith("", ""));
this.assertFalse(ariaUtilsString.endsWith("", "a"));
this.assertTrue(ariaUtilsString.endsWith("a", "a"));
this.assertFalse(ariaUtilsString.endsWith("ab", "a"));
this.assertTrue(ariaUtilsString.endsWith("aba", "a"));
this.assertFalse(ariaUtilsString.endsWith("aba", "b"));
this.assertTrue(ariaUtilsString.endsWith("abc", ""));
this.assertTrue(ariaUtilsString.endsWith("abc", "bc"));
this.assertTrue(ariaUtilsString.endsWith("a b", " b"));
this.assertFalse(ariaUtilsString.endsWith("a b", "a"));
},
assertSelectedAttributeHasLabel: function (attributes, expectedLabel) {
var selected = findAttribute(attributes, "aria-selected", "true");
this.assertEquals(selected.length, 1);
this.assertEquals(selected[0].ownerElement.getAttribute("aria-label"), expectedLabel);
var focusedElement = this.testDocument.activeElement;
var activeDescendant = focusedElement.getAttribute("aria-activedescendant");
if (activeDescendant) {
focusedElement = ariaUtilsDom.getElementById(activeDescendant) || focusedElement;
}
this.assertTrue(ariaUtilsString.endsWith(focusedElement.getAttribute("aria-label"), expectedLabel));
},
testEndsWith : function () {
this.assertTrue(ariaUtilsString.endsWith("", ""));
this.assertFalse(ariaUtilsString.endsWith("", "a"));
this.assertTrue(ariaUtilsString.endsWith("a", "a"));
this.assertFalse(ariaUtilsString.endsWith("ab", "a"));
this.assertTrue(ariaUtilsString.endsWith("aba", "a"));
this.assertFalse(ariaUtilsString.endsWith("aba", "b"));
this.assertTrue(ariaUtilsString.endsWith("abc", ""));
this.assertTrue(ariaUtilsString.endsWith("abc", "bc"));
this.assertTrue(ariaUtilsString.endsWith("a b", " b"));
this.assertFalse(ariaUtilsString.endsWith("a b", "a"));
},