mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-12-25 15:43:00 +03:00
Allow elements to be passed to toContain matcher
This commit is contained in:
parent
2ef6d1be96
commit
d528765161
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
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user