From b6eb3fa9195e06bf9d9dc8f20b227155d74c1c0b Mon Sep 17 00:00:00 2001 From: Caitlin Potter Date: Tue, 30 Sep 2014 13:42:51 -0400 Subject: [PATCH] test(matchers.js): make toHaveClass matcher work better for SVG+jQuery --- test/helpers/matchers.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/helpers/matchers.js b/test/helpers/matchers.js index 1c3b17c39212..43dc34d97514 100644 --- a/test/helpers/matchers.js +++ b/test/helpers/matchers.js @@ -167,9 +167,13 @@ beforeEach(function() { this.message = function() { return "Expected '" + angular.mock.dump(this.actual) + "' to have class '" + clazz + "'."; }; - return this.actual.hasClass ? - this.actual.hasClass(clazz) : - angular.element(this.actual).hasClass(clazz); + var classes = clazz.trim().split(/\s+/); + for (var i=0; i