browser-monkey
Advanced tools
Comparing version 1.26.1 to 1.26.2
@@ -0,0 +0,0 @@ module.exports = function dispatchEvent(el, type){ |
40
index.js
@@ -204,6 +204,6 @@ var retry = require('trytryagain'); | ||
function Selector(selector, finders, options) { | ||
this.selector = selector; | ||
this.finders = finders || []; | ||
this.options = options || { visibleOnly: true }; | ||
this.handlers = []; | ||
this._selector = selector; | ||
this._finders = finders || []; | ||
this._options = options || { visibleOnly: true }; | ||
this._handlers = []; | ||
} | ||
@@ -214,3 +214,3 @@ | ||
Object.keys(options).forEach(function(key){ | ||
self.options[key] = options[key]; | ||
self._options[key] = options[key]; | ||
}); | ||
@@ -221,3 +221,3 @@ return this; | ||
Selector.prototype.get = function(key){ | ||
return this.options[key]; | ||
return this._options[key]; | ||
} | ||
@@ -269,5 +269,5 @@ | ||
Selector.prototype.on = function (handler) { | ||
var handlers = this.handlers.slice(); | ||
var handlers = this._handlers.slice(); | ||
handlers.push(handler); | ||
return this.clone({handlers: handlers}); | ||
return this.clone({_handlers: handlers}); | ||
}; | ||
@@ -278,3 +278,3 @@ | ||
this.handlers.forEach(function (handler) { | ||
this._handlers.forEach(function (handler) { | ||
handler.apply(undefined, args); | ||
@@ -285,5 +285,5 @@ }); | ||
Selector.prototype.addFinder = function (finder) { | ||
var finders = this.finders && this.finders.slice() || []; | ||
var finders = this._finders && this._finders.slice() || []; | ||
finders.push(finder); | ||
return this.clone({finders: finders}); | ||
return this.clone({_finders: finders}); | ||
}; | ||
@@ -318,3 +318,3 @@ | ||
} else { | ||
return this.clone({selector: scope}); | ||
return this.clone({_selector: scope}); | ||
} | ||
@@ -403,3 +403,3 @@ }; | ||
function findWithFinder(el, finderIndex) { | ||
var finder = self.finders[finderIndex]; | ||
var finder = self._finders[finderIndex]; | ||
@@ -410,3 +410,3 @@ if (finder) { | ||
if (!found) { | ||
throw new Error("expected to find: " + self.printFinders(self.finders.slice(0, finderIndex + 1))); | ||
throw new Error("expected to find: " + self.printFinders(self._finders.slice(0, finderIndex + 1))); | ||
} | ||
@@ -421,6 +421,6 @@ | ||
function selector() { | ||
if(self.selector instanceof Element && self.selector.tagName == 'IFRAME') { | ||
return self.selector.contentDocument; | ||
if(self._selector instanceof Element && self._selector.tagName == 'IFRAME') { | ||
return self._selector.contentDocument; | ||
} else { | ||
return self.selector || 'body'; | ||
return self._selector || 'body'; | ||
} | ||
@@ -437,3 +437,3 @@ } | ||
function expectOneElement(scope, elements) { | ||
var msg = "expected to find exactly one element: " + scope.printFinders(scope.finders) + ', but found :' + elementsToString(elements); | ||
var msg = "expected to find exactly one element: " + scope.printFinders(scope._finders) + ', but found :' + elementsToString(elements); | ||
expect(elements.length, msg).to.equal(1); | ||
@@ -469,3 +469,3 @@ } | ||
if (found) { | ||
throw new Error("didn't expect to find element: " + self.printFinders(self.finders)); | ||
throw new Error("didn't expect to find element: " + self.printFinders(self._finders)); | ||
} | ||
@@ -629,3 +629,3 @@ }); | ||
function inferField(component, field){ | ||
var ignoreActions = {constructor: true, options: true}; | ||
var ignoreActions = {constructor: true, _options: true}; | ||
for (var action in component) { | ||
@@ -632,0 +632,0 @@ if (field[action] && !ignoreActions[action]){ |
@@ -0,0 +0,0 @@ // Karma configuration |
{ | ||
"name": "browser-monkey", | ||
"version": "1.26.1", | ||
"version": "1.26.2", | ||
"description": "reliable dom testing", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,0 +0,0 @@ # browser monkey |
@@ -0,0 +0,0 @@ var dispatchEvent = require('./dispatchEvent'); |
@@ -0,0 +0,0 @@ function dispatchEvent(el, type, char) { |
@@ -0,0 +0,0 @@ require('lie/polyfill'); |
@@ -0,0 +0,0 @@ module.exports = function() { |
@@ -0,0 +0,0 @@ var createTestDiv = require('./createTestDiv'); |
@@ -0,0 +0,0 @@ var trace = require('../trace'); |
@@ -0,0 +0,0 @@ module.exports = function(promise) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
77000