Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var isFirstElementFocused = this._createPredicate(function () {
return this._getActiveElement() === ariaUtilsDom.getElementById(dialog.firstInputId);
}, function () {
return 'Focus was not cycled properly while navigating forward.';
var isLastElementFocused = this._createPredicate(function () {
return this._getActiveElement() === ariaUtilsDom.getElementById(dialog.secondInputId);
}, function () {
return 'Focus was not cycled properly while navigating backward.';
function check() {
var dialogInstance = this.getWidgetInstance(id);
var dialogContainer = dialogInstance._popup.domElement;
var labelId = dialogContainer.getAttribute(attributeName);
if (!wai) {
this.assertTrue(
labelId == null,
'Dialog should not have a label.'
);
} else {
var labelElement = ariaUtilsDom.getElementById(labelId);
this.assertTrue(
labelElement != null,
ariaUtilsString.substitute(
'Label element should exist, id: %1', [
labelId
])
);
var actual = labelElement.textContent;
if (actual == null) {
actual = labelElement.innerText;
}
var expected = title;
var isFirstElementFocused = this._createPredicate(function () {
return this._getActiveElement() === ariaUtilsDom.getElementById(dialog.firstInputId);
}, function () {
return 'Focus was not cycled properly while navigating forward.';
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));
},
var isLastElementFocused = this._createPredicate(function () {
return this._getActiveElement() === ariaUtilsDom.getElementById(dialog.secondInputId);
}, function () {
return 'Focus was not cycled properly while navigating backward.';
function check() {
var dialogInstance = this.getWidgetInstance(id);
var dialogContainer = dialogInstance._popup.domElement;
var labelId = dialogContainer.getAttribute(attributeName);
if (!wai) {
this.assertTrue(
labelId == null,
'Dialog should not have a label.'
);
} else {
var labelElement = ariaUtilsDom.getElementById(labelId);
this.assertTrue(
labelElement != null,
subst('Label element should exist, id: %1', labelId)
);
var actual = labelElement.textContent;
if (actual == null) {
actual = labelElement.innerText;
}
var expected = title;
this.assertTrue(
actual === expected,
subst('Label content is not the expected one: "%1" instead of "%2"',