Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

41 lines (33 sloc) 1.038 kB
{ assert, brains, Browser } = require("./helpers")
describe "CSS", ->
describe "style", ->
before (done)->
brains.get "/styled", (req, res)-> res.send """
<html>
<body>
<div id="styled"></div>
</body>
</html>
"""
brains.ready done
before (done)->
browser = new Browser()
browser.visit("http://localhost:3003/styled")
.then =>
@style = browser.query("#styled").style
return
.then(done, done)
it "should be formatted string", ->
@style.opacity = .55
assert.equal typeof @style.opacity, "string"
assert.equal @style.opacity, "0.55"
it "should not accept non-numbers", ->
@style.opacity = ".46"
@style.opacity = "four-six"
assert.equal @style.opacity, "0.46"
it "should default to empty string", ->
@style.opacity = 1.0
@style.opacity = undefined
assert.equal @style.opacity, ""
@style.opacity = null
assert.equal @style.opacity, ""
Jump to Line
Something went wrong with that request. Please try again.