Skip to content

Commit 8dda839

Browse files
committed
Swapped out .hasClass() with .is() when checking for multiple classes
1 parent e388a5e commit 8dda839

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

js/tests/unit/bootstrap-tooltip.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ $(function () {
3333
.tooltip({placement: 'bottom'})
3434
.tooltip('show')
3535

36-
ok($(".tooltip").hasClass('fade bottom in'), 'has correct classes applied')
36+
ok($(".tooltip").is('.fade.bottom.in'), 'has correct classes applied')
3737
tooltip.tooltip('hide')
3838
})
3939

@@ -69,10 +69,10 @@ $(function () {
6969
tooltip.trigger('mouseenter')
7070

7171
setTimeout(function () {
72-
ok(!$(".tooltip").hasClass('fade in'), 'tooltip is not faded in')
72+
ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
7373
tooltip.trigger('mouseout')
7474
setTimeout(function () {
75-
ok(!$(".tooltip").hasClass('fade in'), 'tooltip is not faded in')
75+
ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
7676
start()
7777
}, 200)
7878
}, 100)
@@ -104,10 +104,10 @@ $(function () {
104104
stop()
105105
tooltip.trigger('mouseenter')
106106
setTimeout(function () {
107-
ok(!$(".tooltip").hasClass('fade in'), 'tooltip is not faded in')
107+
ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
108108
tooltip.trigger('mouseout')
109109
setTimeout(function () {
110-
ok(!$(".tooltip").hasClass('fade in'), 'tooltip is not faded in')
110+
ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
111111
start()
112112
}, 100)
113113
}, 50)
@@ -120,9 +120,9 @@ $(function () {
120120
stop()
121121
tooltip.trigger('mouseenter')
122122
setTimeout(function () {
123-
ok(!$(".tooltip").hasClass('fade in'), 'tooltip is not faded in')
123+
ok(!$(".tooltip").is('.fade.in'), 'tooltip is not faded in')
124124
setTimeout(function () {
125-
ok(!$(".tooltip").hasClass('fade in'), 'tooltip has faded in')
125+
ok(!$(".tooltip").is('.fade.in'), 'tooltip has faded in')
126126
start()
127127
}, 200)
128128
}, 100)

0 commit comments

Comments
 (0)