Skip to content

Commit 4869adb

Browse files
committed
Fix test
1 parent 095fd8d commit 4869adb

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/core/compile/attributes.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class Attributes {
7979
if (hasAnimate(this.$$element[0])) {
8080
this.$animate.addClass(this.$$element, classVal);
8181
} else {
82-
this.$$element[0].classList.add(classVal);
82+
this.$$element[0].classList.add(classVal.trim());
8383
}
8484
}
8585
}
@@ -95,7 +95,7 @@ export class Attributes {
9595
if (hasAnimate(this.$$element[0])) {
9696
this.$animate.removeClass(this.$$element, classVal);
9797
} else {
98-
this.$$element[0].classList.remove(classVal);
98+
this.$$element[0].classList.remove(classVal.trim());
9999
}
100100
}
101101
}
@@ -113,7 +113,7 @@ export class Attributes {
113113
if (hasAnimate(this.$$element[0])) {
114114
this.$animate.addClass(this.$$element, toAdd);
115115
} else {
116-
this.$$element[0].classList.add(...toAdd.split(/\s+/));
116+
this.$$element[0].classList.add(...toAdd.trim().split(/\s+/));
117117
}
118118
}
119119

@@ -122,7 +122,7 @@ export class Attributes {
122122
if (hasAnimate(this.$$element[0])) {
123123
this.$animate.removeClass(this.$$element, toRemove);
124124
} else {
125-
this.$$element[0].classList.remove(...toRemove.split(/\s+/));
125+
this.$$element[0].classList.remove(...toRemove.trim().split(/\s+/));
126126
}
127127
}
128128
}

src/core/compile/compile.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3664,7 +3664,9 @@ describe("$compile", () => {
36643664
return {
36653665
transclude: "element",
36663666
link: function (scope, el, attrs, ctrl, transclude) {
3667-
el.after(transclude());
3667+
debugger;
3668+
const res = transclude();
3669+
el.after(res);
36683670
},
36693671
};
36703672
},

0 commit comments

Comments
 (0)