github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/web/elm/tests/PinnedTests.elm (about)

     1  module PinnedTests exposing (all)
     2  
     3  import Expect
     4  import Pinned exposing (ResourcePinState(..), VersionPinState(..))
     5  import Test exposing (Test, describe, test)
     6  
     7  
     8  all : Test
     9  all =
    10      describe "Pinned"
    11          [ test
    12              ("when resource is dynamically pinned, other versions are "
    13                  ++ "NotThePinnedVersion"
    14              )
    15            <|
    16              \_ ->
    17                  Pinned.pinState 1
    18                      0
    19                      (PinnedDynamicallyTo
    20                          { comment = ""
    21                          , pristineComment = ""
    22                          }
    23                          0
    24                      )
    25                      |> Expect.equal NotThePinnedVersion
    26          , test "startPinningTo allows switching without unpinning" <|
    27              \_ ->
    28                  PinnedDynamicallyTo
    29                      { comment = ""
    30                      , pristineComment = ""
    31                      }
    32                      0
    33                      |> Pinned.startPinningTo 1
    34                      |> Expect.equal (Switching { comment = "", pristineComment = "" } 0 1)
    35          ]