Skip to content

Commit 11e1a25

Browse files
committed
remove classList from unit test
1 parent 75d200c commit 11e1a25

File tree

3 files changed

+10
-99
lines changed

3 files changed

+10
-99
lines changed

test/unit/runner.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<!-- include test utilities -->
1515
<script src="utils/mocha.js"></script>
1616
<script src="utils/chai.js"></script>
17-
<script src="utils/classList.js"></script>
1817
<script src="utils/prepare.js"></script>
1918

2019
<!-- specs -->

test/unit/specs/directives.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,22 +169,27 @@ describe('UNIT: Directives', function () {
169169

170170
describe('class', function () {
171171

172+
function contains (el, cls) {
173+
var cur = ' ' + el.className + ' '
174+
return cur.indexOf(' ' + cls + ' ') > -1
175+
}
176+
172177
it('should set class to the value if it has no arg', function () {
173178
var dir = mockDirective('class')
174179
dir.update('test')
175-
assert.ok(dir.el.classList.contains('test'))
180+
assert.ok(contains(dir.el, 'test'))
176181
dir.update('hoho')
177-
assert.ok(!dir.el.classList.contains('test'))
178-
assert.ok(dir.el.classList.contains('hoho'))
182+
assert.ok(!contains(dir.el, 'test'))
183+
assert.ok(contains(dir.el, 'hoho'))
179184
})
180185

181186
it('should add/remove class based on truthy/falsy if it has an arg', function () {
182187
var dir = mockDirective('class')
183188
dir.arg = 'test'
184189
dir.update(true)
185-
assert.ok(dir.el.classList.contains('test'))
190+
assert.ok(contains(dir.el, 'test'))
186191
dir.update(false)
187-
assert.ok(!dir.el.classList.contains('test'))
192+
assert.ok(!contains(dir.el, 'test'))
188193
})
189194

190195
})

test/unit/utils/classList.js

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)