Sha256: 4dbd20ba1867d6ff6178496f5d5ce357685e9a73eea1eebc406576a0c535b339

Contents?: true

Size: 1.67 KB

Versions: 5

Compression:

Stored size: 1.67 KB

Contents

describe UnderOs::UI::Style::Positioning do
  before do
    @view  = UnderOs::UI::View.new
    @style = @view.style
  end

  describe '#contentWidth' do
    before do
      @view = UnderOs::UI::Scroll.new
    end

    it "should allow to set the content sizes" do
      @view.style.contentWidth  = 100
      @view.style.contentHeight = 200

      @view.style.contentWidth.should  == 100
      @view.style.contentHeight.should == 200
    end
  end

  describe '#zIndex' do
    it "should return 0 by default" do
      @view.style.zIndex.should == 0
    end

    it "should allow to change it" do
      @view.style.zIndex = 100
      @view.style.zIndex.should == 100
    end
  end

  describe 'scroller related styles' do
    before do
      @view = UnderOs::UI::Scroll.new
    end

    describe '#overflow' do
      it "accepts 'visible'" do
        @view.style.overflow = 'visible'
        @view.style.overflowX.should == :visible
        @view.style.overflowY.should == :visible
      end

      it "accepts 'hidden'" do
        @view.style.overflow = :hidden
        @view.style.overflowX.should == :hidden
        @view.style.overflowY.should == :hidden
      end

      it "accepts 'x'" do
        @view.style.overflow = 'x'
        @view.style.overflowX.should == :visible
        @view.style.overflowY.should == :hidden
      end

      it "accepts 'y'" do
        @view.style.overflow = 'y'
        @view.style.overflowX.should == :hidden
        @view.style.overflowY.should == :visible
      end

      it "falls back to 'visible'" do
        @view.style.overflow = 'weird stuff'
        @view.style.overflowX.should == :visible
        @view.style.overflowY.should == :visible
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
under-os-1.3.0 spec/lib/under_os/ui/style/positioning_spec.rb
under-os-1.2.1 spec/lib/under_os/ui/style/positioning_spec.rb
under-os-1.2.0 spec/lib/under_os/ui/style/positioning_spec.rb
under-os-1.1.0 spec/lib/under_os/ui/style/positioning_spec.rb
under-os-1.0.0 spec/lib/under_os/ui/style/positioning_spec.rb