mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Allow elements to be passed to toContain matcher
This commit is contained in:
10
vendor/jasmine-jquery.js
vendored
10
vendor/jasmine-jquery.js
vendored
@@ -154,11 +154,15 @@ var jQueryMatchers = {
|
||||
}
|
||||
},
|
||||
|
||||
toContain: function(selector) {
|
||||
toContain: function(contained) {
|
||||
if (this.actual instanceof HTMLElement) {
|
||||
return !!this.actual.querySelector(selector)
|
||||
if (typeof contained === 'string') {
|
||||
return this.actual.querySelector(contained)
|
||||
} else {
|
||||
return this.actual.contains(contained)
|
||||
}
|
||||
} else {
|
||||
return this.actual.find(selector).size() > 0
|
||||
return this.actual.find(contained).size() > 0
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user