elm-ui/tests/suite/Flags.elm

80 lines
1.7 KiB
Elm
Raw Normal View History

2018-12-29 19:46:16 +03:00
module Flags exposing (suite)
2018-08-29 02:41:08 +03:00
2018-12-29 19:46:16 +03:00
{-| -}
import Expect
2018-08-29 02:41:08 +03:00
import Html
import Internal.Flag as Flag
2018-12-29 19:46:16 +03:00
import Test
2018-08-29 02:41:08 +03:00
2018-12-29 19:46:16 +03:00
suite =
Test.describe "Flag Operations"
[ Test.test "All Flags Invalidate Themselves" <|
\_ ->
Expect.equal True (List.all (\flag -> Flag.present flag (Flag.add flag Flag.none)) allFlags)
, Test.test "All Flags don't interfere with each other" <|
\_ ->
Expect.equal True (List.all (doesntInvalidateOthers allFlags) allFlags)
2018-08-29 02:41:08 +03:00
]
2018-12-29 19:46:16 +03:00
doesntInvalidateOthers others flag =
2018-08-29 02:41:08 +03:00
let
withFlag =
Flag.none
|> Flag.add flag
in
2018-12-29 19:46:16 +03:00
List.all identity <|
List.map
(\otherFlag ->
Flag.present otherFlag (Flag.add otherFlag withFlag)
)
others
2018-08-29 02:41:08 +03:00
allFlags =
[ Flag.transparency
, Flag.padding
, Flag.spacing
, Flag.fontSize
, Flag.fontFamily
, Flag.width
, Flag.height
, Flag.bgColor
, Flag.bgImage
, Flag.bgGradient
, Flag.borderStyle
, Flag.fontAlignment
, Flag.fontWeight
, Flag.fontColor
, Flag.wordSpacing
, Flag.letterSpacing
, Flag.borderRound
, Flag.shadows
, Flag.overflow
, Flag.cursor
, Flag.scale
, Flag.rotate
, Flag.moveX
, Flag.moveY
, Flag.borderWidth
, Flag.borderColor
, Flag.yAlign
, Flag.xAlign
, Flag.focus
, Flag.active
, Flag.hover
, Flag.gridTemplate
, Flag.gridPosition
, Flag.heightContent
, Flag.heightFill
, Flag.widthContent
, Flag.widthFill
, Flag.alignRight
, Flag.alignBottom
, Flag.centerX
, Flag.centerY
, Flag.fontVariant
2018-08-29 02:41:08 +03:00
]