summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
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;/)