elm-pages-v3-beta/tests/Example.elm

49 lines
1.5 KiB
Elm
Raw Normal View History

module Example exposing (..)
import Expect exposing (Expectation)
import Pages.Directory as Directory exposing (Directory)
import Pages.PagePath as PagePath exposing (PagePath)
import Test exposing (..)
suite : Test
suite =
describe "includes"
[ test "directory with single file" <|
\() ->
quickStart
2019-10-22 05:11:40 +03:00
|> Directory.includes (Directory.withIndex () [ quickStart ] [ "docs" ])
|> Expect.equal True
, test "directory with two files" <|
\() ->
quickStart
2019-10-22 05:11:40 +03:00
|> Directory.includes (Directory.withIndex () [ performance, quickStart ] [ "docs" ])
|> Expect.equal True
, test "file in different directory" <|
\() ->
notInDocsDir
2019-10-22 05:11:40 +03:00
|> Directory.includes (Directory.withIndex () [ performance, quickStart, notInDocsDir ] [ "docs" ])
|> Expect.equal False
, test "index file is in the directory of the same name" <|
\() ->
docsIndex
2019-10-22 05:11:40 +03:00
|> Directory.includes (Directory.withIndex () [ performance, quickStart, notInDocsDir, docsIndex ] [ "docs" ])
|> Expect.equal True
]
quickStart =
PagePath.build () [ "docs", "quick-start" ]
performance =
PagePath.build () [ "docs", "performance" ]
docsIndex =
PagePath.build () [ "docs" ]
notInDocsDir =
PagePath.build () [ "notInDocsDir" ]