Add issue examples to test suite

This commit is contained in:
Elm UI Automation 2020-05-16 10:57:32 -04:00
parent d5c8a943ea
commit 3747129fb1
12 changed files with 44 additions and 75 deletions

View File

@ -25,7 +25,7 @@ Adding htmlAttribute <| Attr.style "flex-basis" "auto" to clipped el is a workar
import Testable.Element exposing (..)
main =
view =
layout [ width fill, height fill ] <|
column [ width <| px 300 ]
[ el [ clip ] <| text "The quick brown fox" ]

View File

@ -1,4 +1,4 @@
module ElInFixedHeightColumn exposing (..)
module ElInFixedHeightColumn exposing (view)
{-| el inside a fixed height column is rendered with zero height in Safari
@ -7,11 +7,12 @@ module ElInFixedHeightColumn exposing (..)
If I put an el into a column of fixed height, the el is rendered with zero height
in Safari:
layout [] <|
column
[ width fill
, height <| px 200
][ el [ Border.width 3, Border.color <| rgb255 0 0 0 ] <| text "an element" ]
layout [] <|
column
[ width fill
, height <| px 200
]
[ el [ Border.width 3, Border.color <| rgb255 0 0 0 ] <| text "an element" ]
Adding htmlAttribute <| Attr.style "flex-basis" "auto" to the el is a workaround
that fixes the problem in this instance.
@ -27,7 +28,7 @@ import Testable.Element exposing (..)
import Testable.Element.Border as Border
main =
view =
layout [] <|
column
[ width fill

View File

@ -1,4 +1,4 @@
module FocusStylePrecedingElements exposing (main)
module FocusStylePrecedingElements exposing (view)
{-|
@ -27,7 +27,7 @@ import Testable.Element.Font as Font
import Testable.Element.Input as Input
main =
view =
layout [] <|
column []
[ Input.button [] { onPress = Nothing, label = text "Button" }

View File

@ -1,46 +0,0 @@
module InFrontSize exposing (main)
{-|
# inFront elements with width fill are contained within the parent's border
Though they're expected to be the actual size of the parent.
<https://ellie-app.com/8J4KqjL3zGHa1>
<https://github.com/mdgriffith/elm-ui/issues/201>
-}
import Browser
import Html exposing (Html)
import Testable.Element exposing (..)
import Testable.Element.Background as Background
import Testable.Element.Border as Border
main =
layout []
(el
[ width (px 100)
, height (px 100)
, centerX
, centerY
, Background.color (rgb 0.1 0.1 0.1)
, Border.width 20
, Border.color (rgb 0.5 1 1)
-- the following element should cover the parent's border
, inFront
(el
[ width fill
, height fill
, Background.color (rgb 0.1 0.5 0.9)
, moveUp 40
]
none
)
]
none
)

View File

@ -1,4 +1,4 @@
module InFrontSize exposing (main)
module InFrontSize exposing (view)
{-|
@ -16,7 +16,7 @@ import Testable.Element.Background as Background
import Testable.Element.Border as Border
main =
view =
layout []
(el
[ width (px 100)

View File

@ -1,4 +1,4 @@
module Main exposing (..)
module NestedParagraphs exposing (view)
{-| Paragraph with children more than one level deep breaks flow
@ -29,7 +29,7 @@ import Testable.Element as Element exposing (..)
import Testable.Element.Font as Font
main =
view =
layout [] <|
column []
[ paragraph []

View File

@ -1,4 +1,4 @@
module SafariBugIssue147 exposing (main)
module SafariBugIssue147 exposing (view)
{-|
@ -24,12 +24,10 @@ I was able to pinpoint the issue using git bisect to this fd08f1a commit, which
-}
import Browser
import Html exposing (Html)
import Testable.Element exposing (..)
main =
view =
layout [ height fill ] <|
column
[ height fill ]

View File

@ -1,4 +1,4 @@
module Main exposing (main, myElement, sidebar)
module Scrollbar2 exposing (main, myElement, sidebar)
import Element exposing (Element, alignRight, centerY, column, el, fill, height, padding, px, rgb255, row, spacing, text, width)
import Element.Background as Background

View File

@ -1,4 +1,4 @@
module Main exposing (main)
module Scrollbars exposing (main)
import Element exposing (..)
import Element.Background as Background

View File

@ -16,13 +16,11 @@ to scroll or if both have enough content to scroll.
-}
import Html exposing (Html)
import Testable.Element exposing (..)
import Testable.Element.Background as Background
main : Html msg
main =
view =
layout [ height fill ] <|
column [ height fill ]
[ column

View File

@ -1,13 +1,11 @@
module WeirdCentering exposing (main)
module WeirdCentering exposing (view)
import Html exposing (Html)
import Testable.Element exposing (..)
import Testable.Element.Background as Background
main =
view =
layout [] <|
-- row [] [ el [] (text "Example with centerX:") ]
column []
[ text "Example with centerX:"
, row

View File

@ -2,6 +2,12 @@ module Tests.All exposing (main)
{-| -}
import ClippedElInFixedWidthColumn
import ElInFixedHeightColumn
import InFrontSize
import NestedParagraphs
import SafariBugIssue147
import StackedScrollingColumnsHeight
import Testable.Generator
import Testable.Runner
import Tests.Basic
@ -13,6 +19,7 @@ import Tests.RowAlignment
import Tests.RowSpacing
import Tests.TextWrapping
import Tests.Transparency
import WeirdCentering
main : Testable.Runner.TestableProgram
@ -30,6 +37,19 @@ main =
-- , Tuple.pair "Row Alignment" Tests.RowAlignment.view
-- , Tuple.pair "Column Spacing" Tests.ColumnSpacing.view
-- , Tuple.pair "Row Spacing" Tests.RowSpacing.view
[ Tuple.pair "Paragraph wrapping" Tests.TextWrapping.view
]
-- [ Tuple.pair "Paragraph wrapping" Tests.TextWrapping.view
-- ]
-- ,
issues
]
issues =
[ Testable.Runner.rename "Weird Centering" WeirdCentering.view
, Testable.Runner.rename "Stacked scrolling columns height" StackedScrollingColumnsHeight.view
, Testable.Runner.rename "Safari bug issue147" SafariBugIssue147.view
, Testable.Runner.rename "Nested paragraphs" NestedParagraphs.view
, Testable.Runner.rename "In front size" InFrontSize.view
, Testable.Runner.rename "El in fixed height column" ElInFixedHeightColumn.view
, Testable.Runner.rename "Clipped el in fixed width column" ClippedElInFixedWidthColumn.view
]