aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2017-03-14 18:43:22 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2017-03-14 18:43:22 +0100
commitaf45360b7b2a8dc3f3eaed553f9544b4318e7348 (patch)
tree8da54a60d1c23854239996bc5318ccb87e8f1b15 /spec
parent4b6e28689412a3fda9a52f2e665dbc536c87cd8f (diff)
downloadsvg.js-af45360b7b2a8dc3f3eaed553f9544b4318e7348.tar.gz
svg.js-af45360b7b2a8dc3f3eaed553f9544b4318e7348.zip
move most regexe to SVG.regex, fix matrix constructor for string argument
Diffstat (limited to 'spec')
-rw-r--r--spec/spec/element.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/spec/element.js b/spec/spec/element.js
index e20d69e..f4858c7 100644
--- a/spec/spec/element.js
+++ b/spec/spec/element.js
@@ -150,11 +150,17 @@ describe('Element', function() {
expect(stripped(rect.node.style.cssText)).toMatch(/display:block;/)
expect(stripped(rect.node.style.cssText).length).toBe(('display:block;cursor:help;').length)
})
+ it('sets multiple styles with a css string as the first argument', function() {
+ var rect = draw.rect(100,100).style('cursor: help; display: block;')
+ expect(stripped(rect.node.style.cssText)).toMatch(/cursor:help;/)
+ expect(stripped(rect.node.style.cssText)).toMatch(/display:block;/)
+ expect(stripped(rect.node.style.cssText).length).toBe(('display:block;cursor:help;').length)
+ })
it('gets a style with a string key as the fists argument', function() {
var rect = draw.rect(100,100).style({ cursor: 'progress', display: 'block' })
expect(rect.style('cursor')).toBe('progress')
})
- it('gets a style with a string key as the fists argument', function() {
+ it('gets the full css string with no argument', function() {
var rect = draw.rect(100,100).style({ cursor: 's-resize', display: 'none' })
expect(stripped(rect.style())).toMatch(/display:none;/)
expect(stripped(rect.style())).toMatch(/cursor:s-resize;/)