fix(scenario-runner): support data-ng and x-ng based attributes

Prefixed attributes like data-ng-model and x-ng-model were not being
found by the Selector. It was only looking at ng: and ng- prefixed
attributes.
Added a few tests as well to ensure the aforementioned prefixed
attributes are being matched properly.

Closes #1020
This commit is contained in:
Adam Macejak
2012-10-29 21:54:26 -04:00
committed by Igor Minar
parent 085e0ea8ef
commit ad7ce0d402
3 changed files with 41 additions and 2 deletions

View File

@@ -119,7 +119,9 @@ angular.scenario.SpecRunner.prototype.addFutureAction = function(name, behavior,
});
var result = $document.find(selector);
if (selector.match(NG)) {
result = result.add(selector.replace(NG, '[ng-'), $document);
angular.forEach(['[ng-','[data-ng-','[x-ng-'], function(value, index){
result = result.add(selector.replace(NG, value), $document);
});
}
if (!result.length) {
throw {