summaryrefslogtreecommitdiffstats
path: root/debian/missing-sources/epoch/tests/unit/core/d3.coffee
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:26:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:26:01 +0000
commitef03469fec14f1f0358b690934fc173d744f4e7d (patch)
tree8be439d7b2f1d7c8283b745919b9e66481a950e7 /debian/missing-sources/epoch/tests/unit/core/d3.coffee
parentAdding upstream version 5.6.0. (diff)
downloadknot-resolver-9dd90b33afc577fb423c33dea041a0c302dedef3.tar.xz
knot-resolver-9dd90b33afc577fb423c33dea041a0c302dedef3.zip
Adding debian version 5.6.0-1.debian/5.6.0-1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/missing-sources/epoch/tests/unit/core/d3.coffee')
-rw-r--r--debian/missing-sources/epoch/tests/unit/core/d3.coffee40
1 files changed, 40 insertions, 0 deletions
diff --git a/debian/missing-sources/epoch/tests/unit/core/d3.coffee b/debian/missing-sources/epoch/tests/unit/core/d3.coffee
new file mode 100644
index 0000000..1b65c55
--- /dev/null
+++ b/debian/missing-sources/epoch/tests/unit/core/d3.coffee
@@ -0,0 +1,40 @@
+describe 'd3.selection', ->
+ [width, height] = [345, 543, null]
+ [element, id] = [null, 'd3-element']
+
+ before (done) ->
+ element = doc.createElement('DIV')
+ element.id = id
+ doc.body.appendChild(element)
+ d3.select('#' + id).style
+ 'width': width + "px"
+ 'height': height + "px"
+ done()
+
+ describe 'width', ->
+ it 'should return the width of an element', ->
+ assert.equal d3.select('#' + id).width(), width
+
+ it 'should set the width of an element given a number', ->
+ widthNumber = 50
+ d3.select('#'+id).width(widthNumber)
+ assert.equal d3.select('#'+id).width(), widthNumber
+
+ it 'should set the width of an element given a css pixel length', ->
+ widthString = '500px'
+ d3.select('#'+id).width(widthString)
+ assert.equal d3.select('#'+id).width(), +widthString.replace('px', '')
+
+ describe 'height', ->
+ it 'should return the height of an element', ->
+ assert.equal d3.select('#' + id).height(), height
+
+ it 'should set the height of an element given a number', ->
+ heightNumber = 75
+ d3.select('#'+id).height(heightNumber)
+ assert.equal d3.select('#'+id).height(), heightNumber
+
+ it 'should set the height of an element given a css pixel length', ->
+ heightString = '343px'
+ d3.select('#'+id).height(heightString)
+ assert.equal d3.select('#'+id).height(), +heightString.replace('px', '')