Skip to content

Commit

Permalink
Fix issue that surfaced due to node/Node change.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkoolen committed Aug 14, 2018
1 parent 0c09551 commit 5db0dbe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/layout.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function flex(elem=nothing)
style(elem, "display"=>"flex")
end

function container(xs...)
function container(xs::AbstractVector)
dom"div"(xs...)
end

Expand Down
15 changes: 11 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@ using CSSUtil
using WebIO
using Compat.Test

if isdefined(WebIO, :node) # TODO: remove once a new WebIO tag is in
using WebIO: node
else
using WebIO: Node
const node = Node
end

@testset "hbox" begin
el1 = node(:div, "Hello world!")
el2 = node(:div, "Goodbye world!")
box = hbox(el1, el2)
@test props(box)[:style]["display"] == "flex"
@test props(box)[:style]["flex-direction"] == "row"
@test el1 children(box)[1]
@test el2 children(box)[1]
@test el1 children(box)
@test el2 children(box)
end

@testset "vbox" begin
Expand All @@ -18,8 +25,8 @@ end
box = vbox(el1, el2)
@test props(box)[:style]["display"] == "flex"
@test props(box)[:style]["flex-direction"] == "column"
@test el1 children(box)[1]
@test el2 children(box)[1]
@test el1 children(box)
@test el2 children(box)
end

@testset "hline" begin
Expand Down

0 comments on commit 5db0dbe

Please sign in to comment.