jasmine-jquery.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. /*!
  2. Jasmine-jQuery: a set of jQuery helpers for Jasmine tests.
  3. Version 1.5.2
  4. https://github.com/velesin/jasmine-jquery
  5. Copyright (c) 2010-2013 Wojciech Zawistowski, Travis Jeffery
  6. Permission is hereby granted, free of charge, to any person obtaining
  7. a copy of this software and associated documentation files (the
  8. "Software"), to deal in the Software without restriction, including
  9. without limitation the rights to use, copy, modify, merge, publish,
  10. distribute, sublicense, and/or sell copies of the Software, and to
  11. permit persons to whom the Software is furnished to do so, subject to
  12. the following conditions:
  13. The above copyright notice and this permission notice shall be
  14. included in all copies or substantial portions of the Software.
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  18. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  19. LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  20. OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  21. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. */
  23. var readFixtures = function() {
  24. return jasmine.getFixtures().proxyCallTo_('read', arguments)
  25. }
  26. var preloadFixtures = function() {
  27. jasmine.getFixtures().proxyCallTo_('preload', arguments)
  28. }
  29. var loadFixtures = function() {
  30. jasmine.getFixtures().proxyCallTo_('load', arguments)
  31. }
  32. var appendLoadFixtures = function() {
  33. jasmine.getFixtures().proxyCallTo_('appendLoad', arguments)
  34. }
  35. var setFixtures = function(html) {
  36. jasmine.getFixtures().proxyCallTo_('set', arguments)
  37. }
  38. var appendSetFixtures = function() {
  39. jasmine.getFixtures().proxyCallTo_('appendSet', arguments)
  40. }
  41. var sandbox = function(attributes) {
  42. return jasmine.getFixtures().sandbox(attributes)
  43. }
  44. var spyOnEvent = function(selector, eventName) {
  45. return jasmine.JQuery.events.spyOn(selector, eventName)
  46. }
  47. var preloadStyleFixtures = function() {
  48. jasmine.getStyleFixtures().proxyCallTo_('preload', arguments)
  49. }
  50. var loadStyleFixtures = function() {
  51. jasmine.getStyleFixtures().proxyCallTo_('load', arguments)
  52. }
  53. var appendLoadStyleFixtures = function() {
  54. jasmine.getStyleFixtures().proxyCallTo_('appendLoad', arguments)
  55. }
  56. var setStyleFixtures = function(html) {
  57. jasmine.getStyleFixtures().proxyCallTo_('set', arguments)
  58. }
  59. var appendSetStyleFixtures = function(html) {
  60. jasmine.getStyleFixtures().proxyCallTo_('appendSet', arguments)
  61. }
  62. var loadJSONFixtures = function() {
  63. return jasmine.getJSONFixtures().proxyCallTo_('load', arguments)
  64. }
  65. var getJSONFixture = function(url) {
  66. return jasmine.getJSONFixtures().proxyCallTo_('read', arguments)[url]
  67. }
  68. jasmine.spiedEventsKey = function (selector, eventName) {
  69. return [$(selector).selector, eventName].toString()
  70. }
  71. jasmine.getFixtures = function() {
  72. return jasmine.currentFixtures_ = jasmine.currentFixtures_ || new jasmine.Fixtures()
  73. }
  74. jasmine.getStyleFixtures = function() {
  75. return jasmine.currentStyleFixtures_ = jasmine.currentStyleFixtures_ || new jasmine.StyleFixtures()
  76. }
  77. jasmine.Fixtures = function() {
  78. this.containerId = 'jasmine-fixtures'
  79. this.fixturesCache_ = {}
  80. this.fixturesPath = 'spec/javascripts/fixtures'
  81. }
  82. jasmine.Fixtures.prototype.set = function(html) {
  83. this.cleanUp()
  84. this.createContainer_(html)
  85. }
  86. jasmine.Fixtures.prototype.appendSet= function(html) {
  87. this.addToContainer_(html)
  88. }
  89. jasmine.Fixtures.prototype.preload = function() {
  90. this.read.apply(this, arguments)
  91. }
  92. jasmine.Fixtures.prototype.load = function() {
  93. this.cleanUp()
  94. this.createContainer_(this.read.apply(this, arguments))
  95. }
  96. jasmine.Fixtures.prototype.appendLoad = function() {
  97. this.addToContainer_(this.read.apply(this, arguments))
  98. }
  99. jasmine.Fixtures.prototype.read = function() {
  100. var htmlChunks = []
  101. var fixtureUrls = arguments
  102. for(var urlCount = fixtureUrls.length, urlIndex = 0; urlIndex < urlCount; urlIndex++) {
  103. htmlChunks.push(this.getFixtureHtml_(fixtureUrls[urlIndex]))
  104. }
  105. return htmlChunks.join('')
  106. }
  107. jasmine.Fixtures.prototype.clearCache = function() {
  108. this.fixturesCache_ = {}
  109. }
  110. jasmine.Fixtures.prototype.cleanUp = function() {
  111. $('#' + this.containerId).remove()
  112. }
  113. jasmine.Fixtures.prototype.sandbox = function(attributes) {
  114. var attributesToSet = attributes || {}
  115. return $('<div id="sandbox" />').attr(attributesToSet)
  116. }
  117. jasmine.Fixtures.prototype.createContainer_ = function(html) {
  118. var container
  119. if(html instanceof $) {
  120. container = $('<div id="' + this.containerId + '" />')
  121. container.html(html)
  122. } else {
  123. container = '<div id="' + this.containerId + '">' + html + '</div>'
  124. }
  125. $(document.body).append(container)
  126. }
  127. jasmine.Fixtures.prototype.addToContainer_ = function(html){
  128. var container = $(document.body).find('#'+this.containerId).append(html)
  129. if(!container.length){
  130. this.createContainer_(html)
  131. }
  132. }
  133. jasmine.Fixtures.prototype.getFixtureHtml_ = function(url) {
  134. if (typeof this.fixturesCache_[url] === 'undefined') {
  135. this.loadFixtureIntoCache_(url)
  136. }
  137. return this.fixturesCache_[url]
  138. }
  139. jasmine.Fixtures.prototype.loadFixtureIntoCache_ = function(relativeUrl) {
  140. var url = this.makeFixtureUrl_(relativeUrl)
  141. var request = $.ajax({
  142. type: "GET",
  143. url: url + "?" + new Date().getTime(),
  144. async: false
  145. })
  146. this.fixturesCache_[relativeUrl] = request.responseText
  147. }
  148. jasmine.Fixtures.prototype.makeFixtureUrl_ = function(relativeUrl){
  149. return this.fixturesPath.match('/$') ? this.fixturesPath + relativeUrl : this.fixturesPath + '/' + relativeUrl
  150. }
  151. jasmine.Fixtures.prototype.proxyCallTo_ = function(methodName, passedArguments) {
  152. return this[methodName].apply(this, passedArguments)
  153. }
  154. jasmine.StyleFixtures = function() {
  155. this.fixturesCache_ = {}
  156. this.fixturesNodes_ = []
  157. this.fixturesPath = 'spec/javascripts/fixtures'
  158. }
  159. jasmine.StyleFixtures.prototype.set = function(css) {
  160. this.cleanUp()
  161. this.createStyle_(css)
  162. }
  163. jasmine.StyleFixtures.prototype.appendSet = function(css) {
  164. this.createStyle_(css)
  165. }
  166. jasmine.StyleFixtures.prototype.preload = function() {
  167. this.read_.apply(this, arguments)
  168. }
  169. jasmine.StyleFixtures.prototype.load = function() {
  170. this.cleanUp()
  171. this.createStyle_(this.read_.apply(this, arguments))
  172. }
  173. jasmine.StyleFixtures.prototype.appendLoad = function() {
  174. this.createStyle_(this.read_.apply(this, arguments))
  175. }
  176. jasmine.StyleFixtures.prototype.cleanUp = function() {
  177. while(this.fixturesNodes_.length) {
  178. this.fixturesNodes_.pop().remove()
  179. }
  180. }
  181. jasmine.StyleFixtures.prototype.createStyle_ = function(html) {
  182. var styleText = $('<div></div>').html(html).text(),
  183. style = $('<style>' + styleText + '</style>')
  184. this.fixturesNodes_.push(style)
  185. $('head').append(style)
  186. }
  187. jasmine.StyleFixtures.prototype.clearCache = jasmine.Fixtures.prototype.clearCache
  188. jasmine.StyleFixtures.prototype.read_ = jasmine.Fixtures.prototype.read
  189. jasmine.StyleFixtures.prototype.getFixtureHtml_ = jasmine.Fixtures.prototype.getFixtureHtml_
  190. jasmine.StyleFixtures.prototype.loadFixtureIntoCache_ = jasmine.Fixtures.prototype.loadFixtureIntoCache_
  191. jasmine.StyleFixtures.prototype.makeFixtureUrl_ = jasmine.Fixtures.prototype.makeFixtureUrl_
  192. jasmine.StyleFixtures.prototype.proxyCallTo_ = jasmine.Fixtures.prototype.proxyCallTo_
  193. jasmine.getJSONFixtures = function() {
  194. return jasmine.currentJSONFixtures_ = jasmine.currentJSONFixtures_ || new jasmine.JSONFixtures()
  195. }
  196. jasmine.JSONFixtures = function() {
  197. this.fixturesCache_ = {}
  198. this.fixturesPath = 'spec/javascripts/fixtures/json'
  199. }
  200. jasmine.JSONFixtures.prototype.load = function() {
  201. this.read.apply(this, arguments)
  202. return this.fixturesCache_
  203. }
  204. jasmine.JSONFixtures.prototype.read = function() {
  205. var fixtureUrls = arguments
  206. for(var urlCount = fixtureUrls.length, urlIndex = 0; urlIndex < urlCount; urlIndex++) {
  207. this.getFixtureData_(fixtureUrls[urlIndex])
  208. }
  209. return this.fixturesCache_
  210. }
  211. jasmine.JSONFixtures.prototype.clearCache = function() {
  212. this.fixturesCache_ = {}
  213. }
  214. jasmine.JSONFixtures.prototype.getFixtureData_ = function(url) {
  215. this.loadFixtureIntoCache_(url)
  216. return this.fixturesCache_[url]
  217. }
  218. jasmine.JSONFixtures.prototype.loadFixtureIntoCache_ = function(relativeUrl) {
  219. var self = this
  220. var url = this.fixturesPath.match('/$') ? this.fixturesPath + relativeUrl : this.fixturesPath + '/' + relativeUrl
  221. $.ajax({
  222. async: false, // must be synchronous to guarantee that no tests are run before fixture is loaded
  223. cache: false,
  224. dataType: 'json',
  225. url: url,
  226. success: function(data) {
  227. self.fixturesCache_[relativeUrl] = data
  228. },
  229. error: function(jqXHR, status, errorThrown) {
  230. throw Error('JSONFixture could not be loaded: ' + url + ' (status: ' + status + ', message: ' + errorThrown.message + ')')
  231. }
  232. })
  233. }
  234. jasmine.JSONFixtures.prototype.proxyCallTo_ = function(methodName, passedArguments) {
  235. return this[methodName].apply(this, passedArguments)
  236. }
  237. jasmine.JQuery = function() {}
  238. jasmine.JQuery.browserTagCaseIndependentHtml = function(html) {
  239. return $('<div/>').append(html).html()
  240. }
  241. jasmine.JQuery.elementToString = function(element) {
  242. var domEl = $(element).get(0)
  243. if (domEl == undefined || domEl.cloneNode)
  244. return $('<div />').append($(element).clone()).html()
  245. else
  246. return element.toString()
  247. }
  248. jasmine.JQuery.matchersClass = {}
  249. !function(namespace) {
  250. var data = {
  251. spiedEvents: {},
  252. handlers: []
  253. }
  254. namespace.events = {
  255. spyOn: function(selector, eventName) {
  256. var handler = function(e) {
  257. data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)] = jasmine.util.argsToArray(arguments)
  258. }
  259. $(selector).on(eventName, handler)
  260. data.handlers.push(handler)
  261. return {
  262. selector: selector,
  263. eventName: eventName,
  264. handler: handler,
  265. reset: function(){
  266. delete data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)]
  267. }
  268. }
  269. },
  270. args: function(selector, eventName) {
  271. var actualArgs = data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)];
  272. if (!actualArgs) {
  273. throw "There is no spy for " + eventName + " on " + selector.toString() + ". Make sure to create a spy using spyOnEvent.";
  274. }
  275. return actualArgs;
  276. },
  277. wasTriggered: function(selector, eventName) {
  278. return !!(data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)])
  279. },
  280. wasTriggeredWith: function(selector, eventName, expectedArgs, env) {
  281. var actualArgs = jasmine.JQuery.events.args(selector, eventName).slice(1);
  282. if (Object.prototype.toString.call(expectedArgs) !== '[object Array]') {
  283. actualArgs = actualArgs[0];
  284. }
  285. return env.equals_(expectedArgs, actualArgs);
  286. },
  287. wasPrevented: function(selector, eventName) {
  288. var args = data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)],
  289. e = args ? args[0] : undefined;
  290. return e && e.isDefaultPrevented()
  291. },
  292. wasStopped: function(selector, eventName) {
  293. var args = data.spiedEvents[jasmine.spiedEventsKey(selector, eventName)],
  294. e = args ? args[0] : undefined;
  295. return e && e.isPropagationStopped()
  296. },
  297. cleanUp: function() {
  298. data.spiedEvents = {}
  299. data.handlers = []
  300. }
  301. }
  302. }(jasmine.JQuery)
  303. !function(){
  304. var jQueryMatchers = {
  305. toHaveClass: function(className) {
  306. return this.actual.hasClass(className)
  307. },
  308. toHaveCss: function(css){
  309. for (var prop in css){
  310. if (this.actual.css(prop) !== css[prop]) return false
  311. }
  312. return true
  313. },
  314. toBeVisible: function() {
  315. return this.actual.is(':visible')
  316. },
  317. toBeHidden: function() {
  318. return this.actual.is(':hidden')
  319. },
  320. toBeSelected: function() {
  321. return this.actual.is(':selected')
  322. },
  323. toBeChecked: function() {
  324. return this.actual.is(':checked')
  325. },
  326. toBeEmpty: function() {
  327. return this.actual.is(':empty')
  328. },
  329. toExist: function() {
  330. return $(document).find(this.actual).length
  331. },
  332. toHaveLength: function(length) {
  333. return this.actual.length === length
  334. },
  335. toHaveAttr: function(attributeName, expectedAttributeValue) {
  336. return hasProperty(this.actual.attr(attributeName), expectedAttributeValue)
  337. },
  338. toHaveProp: function(propertyName, expectedPropertyValue) {
  339. return hasProperty(this.actual.prop(propertyName), expectedPropertyValue)
  340. },
  341. toHaveId: function(id) {
  342. return this.actual.attr('id') == id
  343. },
  344. toHaveHtml: function(html) {
  345. return this.actual.html() == jasmine.JQuery.browserTagCaseIndependentHtml(html)
  346. },
  347. toContainHtml: function(html){
  348. var actualHtml = this.actual.html()
  349. var expectedHtml = jasmine.JQuery.browserTagCaseIndependentHtml(html)
  350. return (actualHtml.indexOf(expectedHtml) >= 0)
  351. },
  352. toHaveText: function(text) {
  353. var trimmedText = $.trim(this.actual.text())
  354. if (text && $.isFunction(text.test)) {
  355. return text.test(trimmedText)
  356. } else {
  357. return trimmedText == text
  358. }
  359. },
  360. toContainText: function(text) {
  361. var trimmedText = $.trim(this.actual.text())
  362. if (text && $.isFunction(text.test)) {
  363. return text.test(trimmedText)
  364. } else {
  365. return trimmedText.indexOf(text) != -1;
  366. }
  367. },
  368. toHaveValue: function(value) {
  369. return this.actual.val() === value
  370. },
  371. toHaveData: function(key, expectedValue) {
  372. return hasProperty(this.actual.data(key), expectedValue)
  373. },
  374. toBe: function(selector) {
  375. return this.actual.is(selector)
  376. },
  377. toContain: function(selector) {
  378. return this.actual.find(selector).length
  379. },
  380. toBeDisabled: function(selector){
  381. return this.actual.is(':disabled')
  382. },
  383. toBeFocused: function(selector) {
  384. return this.actual[0] === this.actual[0].ownerDocument.activeElement
  385. },
  386. toHandle: function(event) {
  387. var events = $._data(this.actual.get(0), "events")
  388. if(!events || !event || typeof event !== "string") {
  389. return false
  390. }
  391. var namespaces = event.split(".")
  392. var eventType = namespaces.shift()
  393. var sortedNamespaces = namespaces.slice(0).sort()
  394. var namespaceRegExp = new RegExp("(^|\\.)" + sortedNamespaces.join("\\.(?:.*\\.)?") + "(\\.|$)")
  395. if(events[eventType] && namespaces.length) {
  396. for(var i = 0; i < events[eventType].length; i++) {
  397. var namespace = events[eventType][i].namespace
  398. if(namespaceRegExp.test(namespace)) {
  399. return true
  400. }
  401. }
  402. } else {
  403. return events[eventType] && events[eventType].length > 0
  404. }
  405. },
  406. // tests the existence of a specific event binding + handler
  407. toHandleWith: function(eventName, eventHandler) {
  408. var stack = $._data(this.actual.get(0), "events")[eventName]
  409. for (var i = 0; i < stack.length; i++) {
  410. if (stack[i].handler == eventHandler) return true
  411. }
  412. return false
  413. }
  414. }
  415. var hasProperty = function(actualValue, expectedValue) {
  416. if (expectedValue === undefined) return actualValue !== undefined
  417. return actualValue == expectedValue
  418. }
  419. var bindMatcher = function(methodName) {
  420. var builtInMatcher = jasmine.Matchers.prototype[methodName]
  421. jasmine.JQuery.matchersClass[methodName] = function() {
  422. if (this.actual
  423. && (this.actual instanceof $
  424. || jasmine.isDomNode(this.actual))) {
  425. this.actual = $(this.actual)
  426. var result = jQueryMatchers[methodName].apply(this, arguments)
  427. var element
  428. if (this.actual.get && (element = this.actual.get()[0]) && !$.isWindow(element) && element.tagName !== "HTML")
  429. this.actual = jasmine.JQuery.elementToString(this.actual)
  430. return result
  431. }
  432. if (builtInMatcher) {
  433. return builtInMatcher.apply(this, arguments)
  434. }
  435. return false
  436. }
  437. }
  438. for(var methodName in jQueryMatchers) {
  439. bindMatcher(methodName)
  440. }
  441. }()
  442. beforeEach(function() {
  443. this.addMatchers(jasmine.JQuery.matchersClass)
  444. this.addMatchers({
  445. toHaveBeenTriggeredOn: function(selector) {
  446. this.message = function() {
  447. return [
  448. "Expected event " + this.actual + " to have been triggered on " + selector,
  449. "Expected event " + this.actual + " not to have been triggered on " + selector
  450. ]
  451. }
  452. return jasmine.JQuery.events.wasTriggered(selector, this.actual)
  453. }
  454. })
  455. this.addMatchers({
  456. toHaveBeenTriggered: function(){
  457. var eventName = this.actual.eventName,
  458. selector = this.actual.selector
  459. this.message = function() {
  460. return [
  461. "Expected event " + eventName + " to have been triggered on " + selector,
  462. "Expected event " + eventName + " not to have been triggered on " + selector
  463. ]
  464. }
  465. return jasmine.JQuery.events.wasTriggered(selector, eventName)
  466. }
  467. })
  468. this.addMatchers({
  469. toHaveBeenTriggeredOnAndWith: function() {
  470. var selector = arguments[0],
  471. expectedArgs = arguments[1],
  472. wasTriggered = jasmine.JQuery.events.wasTriggered(selector, this.actual);
  473. this.message = function() {
  474. if (wasTriggered) {
  475. var actualArgs = jasmine.JQuery.events.args(selector, this.actual, expectedArgs)[1];
  476. return [
  477. "Expected event " + this.actual + " to have been triggered with " + jasmine.pp(expectedArgs) + " but it was triggered with " + jasmine.pp(actualArgs),
  478. "Expected event " + this.actual + " not to have been triggered with " + jasmine.pp(expectedArgs) + " but it was triggered with " + jasmine.pp(actualArgs)
  479. ]
  480. } else {
  481. return [
  482. "Expected event " + this.actual + " to have been triggered on " + selector,
  483. "Expected event " + this.actual + " not to have been triggered on " + selector
  484. ]
  485. }
  486. }
  487. return wasTriggered && jasmine.JQuery.events.wasTriggeredWith(selector, this.actual, expectedArgs, this.env);
  488. }
  489. })
  490. this.addMatchers({
  491. toHaveBeenPreventedOn: function(selector) {
  492. this.message = function() {
  493. return [
  494. "Expected event " + this.actual + " to have been prevented on " + selector,
  495. "Expected event " + this.actual + " not to have been prevented on " + selector
  496. ]
  497. }
  498. return jasmine.JQuery.events.wasPrevented(selector, this.actual)
  499. }
  500. })
  501. this.addMatchers({
  502. toHaveBeenPrevented: function() {
  503. var eventName = this.actual.eventName,
  504. selector = this.actual.selector
  505. this.message = function() {
  506. return [
  507. "Expected event " + eventName + " to have been prevented on " + selector,
  508. "Expected event " + eventName + " not to have been prevented on " + selector
  509. ]
  510. }
  511. return jasmine.JQuery.events.wasPrevented(selector, eventName)
  512. }
  513. })
  514. this.addMatchers({
  515. toHaveBeenStoppedOn: function(selector) {
  516. this.message = function() {
  517. return [
  518. "Expected event " + this.actual + " to have been stopped on " + selector,
  519. "Expected event " + this.actual + " not to have been stopped on " + selector
  520. ]
  521. }
  522. return jasmine.JQuery.events.wasStopped(selector, this.actual)
  523. }
  524. })
  525. this.addMatchers({
  526. toHaveBeenStopped: function() {
  527. var eventName = this.actual.eventName,
  528. selector = this.actual.selector
  529. this.message = function() {
  530. return [
  531. "Expected event " + eventName + " to have been stopped on " + selector,
  532. "Expected event " + eventName + " not to have been stopped on " + selector
  533. ]
  534. }
  535. return jasmine.JQuery.events.wasStopped(selector, eventName)
  536. }
  537. })
  538. })
  539. afterEach(function() {
  540. jasmine.getFixtures().cleanUp()
  541. jasmine.getStyleFixtures().cleanUp()
  542. jasmine.JQuery.events.cleanUp()
  543. })