require 'minitest_helper' module SlideHero describe List do it "takes a block of items to list" do list = List.new do point "A thing" point "another" end assert_dom_match(list.compile, '') end it "returns an ordered list" do list = List.new(:ordered) do point "A thing" point "another" end assert_dom_match(list.compile, '
  1. A thing
  2. another
') end it "supports animations" do list = List.new do point "animated!", animation: true end assert_dom_match(list.compile, '') end it "supports specific animations" do supported_animations = %w{grow shrink roll-in fade-out highlight-red highlight-green highlight-blue} supported_animations.each do |animation| list = List.new do point "all the animations!", animation: animation end assert_dom_match list.compile, '' end end it "allows lists to be nested in lists - unordered" do list = List.new do point "Regular point" list do point "I'm a point in a point" end point "Another regular point" end assert_dom_match(list.compile, %{}) end it "allows lists to be nested in lists - ordered" do list = List.new(:ordered) do point "Regular point" list do point "I'm a point in a point" end point "Another regular point" end assert_dom_match(list.compile, %{
  1. Regular point
  2. Another regular point
}) end end end