aboutsummaryrefslogtreecommitdiffhomepage
path: root/public/bower_components/morris.js/spec/lib/area
diff options
context:
space:
mode:
authorMarvin Borner2018-07-13 19:06:45 +0200
committerMarvin Borner2018-07-13 19:06:45 +0200
commit6fcfb7c04d32e1c8b26a312295bf7ac3ec2d2ad7 (patch)
treedbc87ef16fa01d5d99116de283592b8fe5e02944 /public/bower_components/morris.js/spec/lib/area
parentdfd839f27146df0ad0494e11734fc7d310c70ebf (diff)
Fixed many permissions and began admin interface
Diffstat (limited to 'public/bower_components/morris.js/spec/lib/area')
-rw-r--r--public/bower_components/morris.js/spec/lib/area/area_spec.coffee60
1 files changed, 60 insertions, 0 deletions
diff --git a/public/bower_components/morris.js/spec/lib/area/area_spec.coffee b/public/bower_components/morris.js/spec/lib/area/area_spec.coffee
new file mode 100644
index 0000000..fa36b2e
--- /dev/null
+++ b/public/bower_components/morris.js/spec/lib/area/area_spec.coffee
@@ -0,0 +1,60 @@
+describe 'Morris.Area', ->
+
+ describe 'svg structure', ->
+ defaults =
+ element: 'graph'
+ data: [{x: '2012 Q1', y: 1}, {x: '2012 Q2', y: 1}]
+ lineColors: [ '#0b62a4', '#7a92a3']
+ gridLineColor: '#aaa'
+ xkey: 'x'
+ ykeys: ['y']
+ labels: ['Y']
+
+ it 'should contain a line path for each line', ->
+ chart = Morris.Area $.extend {}, defaults
+ $('#graph').find("path[stroke='#0b62a4']").size().should.equal 1
+
+ it 'should contain a path with stroke-width 0 for each line', ->
+ chart = Morris.Area $.extend {}, defaults
+ $('#graph').find("path[stroke='#0b62a4']").size().should.equal 1
+
+ it 'should contain 5 grid lines', ->
+ chart = Morris.Area $.extend {}, defaults
+ $('#graph').find("path[stroke='#aaaaaa']").size().should.equal 5
+
+ it 'should contain 9 text elements', ->
+ chart = Morris.Area $.extend {}, defaults
+ $('#graph').find("text").size().should.equal 9
+
+ describe 'svg attributes', ->
+ defaults =
+ element: 'graph'
+ data: [{x: '2012 Q1', y: 1}, {x: '2012 Q2', y: 1}]
+ xkey: 'x'
+ ykeys: ['y']
+ labels: ['Y']
+ lineColors: [ '#0b62a4', '#7a92a3']
+ lineWidth: 3
+ pointWidths: [5]
+ pointStrokeColors: ['#ffffff']
+ gridLineColor: '#aaa'
+ gridStrokeWidth: 0.5
+ gridTextColor: '#888'
+ gridTextSize: 12
+
+ it 'should not be cumulative if behaveLikeLine', ->
+ chart = Morris.Area $.extend {}, defaults, behaveLikeLine: true
+ chart.cumulative.should.equal false
+
+ it 'should have a line with transparent fill if behaveLikeLine', ->
+ chart = Morris.Area $.extend {}, defaults, behaveLikeLine: true
+ $('#graph').find("path[fill-opacity='0.8']").size().should.equal 1
+
+ it 'should not have a line with transparent fill', ->
+ chart = Morris.Area $.extend {}, defaults
+ $('#graph').find("path[fill-opacity='0.8']").size().should.equal 0
+
+ it 'should have a line with the fill of a modified line color', ->
+ chart = Morris.Area $.extend {}, defaults
+ $('#graph').find("path[fill='#0b62a4']").size().should.equal 0
+ $('#graph').find("path[fill='#7a92a3']").size().should.equal 0