Skip to content

Commit 378c168

Browse files
author
pemrouz
committed
test: update signatures
1 parent 08c98a4 commit 378c168

File tree

1 file changed

+7
-23
lines changed

1 file changed

+7
-23
lines changed

test.js

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ describe('Custom Elements', function(){
4646
expect(result2).to.equal(el2)
4747
done()
4848
})
49-
5049
})
5150

5251
it('should draw a d3 node', function(done){
@@ -76,7 +75,7 @@ describe('Custom Elements', function(){
7675
, result
7776

7877
ripple('array', [1, 2, 3])
79-
ripple('component-5', function(d){ result = d })
78+
ripple('component-5', function(n, d){ result = d })
8079

8180
time(20, function(){
8281
expect(result).to.eql({ array: [1, 2, 3] })
@@ -91,7 +90,7 @@ describe('Custom Elements', function(){
9190

9291
ripple('array', [1, 2, 3])
9392
ripple('object', { foo: 'bar' })
94-
ripple('component-6', function(d){ result = d })
93+
ripple('component-6', function(n, d){ result = d })
9594

9695
time(20, function(){
9796
expect(result).to.eql({ array: [1, 2, 3], object: { foo: 'bar' }})
@@ -105,7 +104,7 @@ describe('Custom Elements', function(){
105104
, result
106105

107106
el.__data__ = { foo: 'bar' }
108-
ripple('component-7', function(d){ result = d })
107+
ripple('component-7', function(n, d){ result = d })
109108

110109
time(20, function(){
111110
expect(result).to.eql({ foo: 'bar' })
@@ -119,7 +118,7 @@ describe('Custom Elements', function(){
119118
, result
120119

121120
el.state = { focused: true }
122-
ripple('component-8', function(d){ result = d })
121+
ripple('component-8', function(n, d){ result = d })
123122

124123
time(20, function(){
125124
expect(result).to.eql({ focused: true })
@@ -135,7 +134,7 @@ describe('Custom Elements', function(){
135134
el.__data__ = { foo: 'bar' }
136135
el.state = { focused: true }
137136
ripple('array', [1, 2, 3])
138-
ripple('component-9', function(d){ result = d })
137+
ripple('component-9', function(n, d){ result = d })
139138

140139
time(20, function(){
141140
expect(result)
@@ -266,7 +265,6 @@ describe('Custom Elements', function(){
266265
done()
267266
})
268267
})
269-
270268
})
271269

272270
it('should not draw if missing deps', function(done){
@@ -349,7 +347,6 @@ describe('Custom Elements', function(){
349347
document.registerElement = original
350348
done()
351349
})
352-
353350
})
354351

355352
it('should always extend existing state', function(done){
@@ -408,19 +405,6 @@ describe('Custom Elements', function(){
408405
})
409406
})
410407

411-
it('should pass index as implicit data', function(done){
412-
var el = once(container)('component-26', 1).node()
413-
, ripple = components(fn(data(core())))
414-
, result
415-
416-
ripple('component-26', function(d, i){ result = i })
417-
418-
time(40, function(){
419-
expect(result).to.be.eql(0)
420-
done()
421-
})
422-
})
423-
424408
it('should draw server-rendered elements', function(done){
425409
var ripple = components(fn(data(core())))
426410
, result
@@ -464,8 +448,8 @@ describe('Custom Elements', function(){
464448
, result1, result2
465449

466450
Object.defineProperty(elB, 'shadowRoot', { value: elA })
467-
ripple('component-29', function(d, i, el){ result1 = el })
468-
ripple('component-30', function(d, i, el){ result2 = el })
451+
ripple('component-29', function(n, d){ result1 = n })
452+
ripple('component-30', function(n, d){ result2 = n })
469453

470454
time(40, function(){
471455
expect(lo(result1.nodeName)).to.be.eql('component-29')

0 commit comments

Comments
 (0)