#!/usr/bin/env ruby
      
# Copyright (c) 2009 Cory Ondrejka. All rights reserved.
# See License.txt for licensing details.

require "#{File.dirname(__FILE__)}/../testing_file_support"

describe BalsamiqControlParser do
  it "properly handles datechooser" do
    data = <<-EOF
            <mockup version="1.0" skin="sketch">
      <controls>
        <control controlID="3" controlTypeID="com.balsamiq.mockups::DateChooser" x="38" y="23" w="171" h="-1" zOrder="0" locked="false" isInGroup="-1">
          <controlProperties>
            <text>01/22/08</text>
          </controlProperties>
        </control>
        <control controlID="4" controlTypeID="com.balsamiq.mockups::DateChooser" x="34" y="64" w="-1" h="-1" zOrder="1" locked="false" isInGroup="-1">
          <controlProperties>
            <text>%20%20/%20%20/%20%20%20%20</text>
          </controlProperties>
        </control>
      </controls>
    </mockup>    


    EOF
    html = <<-EOF
    <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by Balsamiq Exporter -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" type="text/css" href="reset.css" />
    <title>Balsamiq</title>
    <script type="text/javascript">
    </script>
  </head>

  <body>
    <div class="DateChooser" id="DateChooser3" 
          style="position: absolute; left: 38px; top: 23px; width: 171px; height: 25px; z-index: ;
          font-size:10pt; background-color: transparent; outline: none">
      <div class="DateChooser" id="DateChooser3" 
            style="padding-left: 4px; text-align: left; float: left; top: 23; width: 132px; height: 25px; z-index: ;">
        01/22/08
      </div>
      <div class="DateChooser" id="DateChooser3" 
            style="float: right; top: 23; width: 27px; height: 25px; z-index: ;">
      </div>
    </div>
    <div class="DateChooser" id="DateChooser4" 
          style="position: absolute; left: 34px; top: 64px; width: 106px; height: 25px; z-index: ;
          font-size:10pt; background-color: transparent; outline: none">
      <div class="DateChooser" id="DateChooser4" 
            style="padding-left: 4px; text-align: left; float: left; top: 64; width: 67px; height: 25px; z-index: ;">
        &nbsp&nbsp/&nbsp&nbsp/&nbsp&nbsp&nbsp&nbsp
      </div>
      <div class="DateChooser" id="DateChooser4" 
            style="float: right; top: 64; width: 27px; height: 25px; z-index: ;">
      </div>
    </div>
  </body>
</html>

    EOF
    css = <<-EOF

    EOF
    js = <<-EOF

    EOF
    filename = "datechooser"
    TestingFileSupport::test_elements(filename, data, html, css, js, false)
  end

end
