2019-09-15 21:22:38 +03:00
|
|
|
module Example exposing (..)
|
|
|
|
|
|
|
|
import Expect exposing (Expectation)
|
2019-09-15 21:46:00 +03:00
|
|
|
import Pages.Directory as Directory exposing (Directory)
|
|
|
|
import Pages.PagePath as PagePath exposing (PagePath)
|
2019-09-15 21:22:38 +03:00
|
|
|
import Test exposing (..)
|
|
|
|
|
|
|
|
|
|
|
|
suite : Test
|
|
|
|
suite =
|
2019-09-15 21:46:00 +03:00
|
|
|
describe "includes"
|
|
|
|
[ test "directory with single file" <|
|
|
|
|
\() ->
|
|
|
|
quickStart
|
2019-10-22 05:11:40 +03:00
|
|
|
|> Directory.includes (Directory.withIndex () [ quickStart ] [ "docs" ])
|
2019-09-15 21:46:00 +03:00
|
|
|
|> Expect.equal True
|
|
|
|
, test "directory with two files" <|
|
|
|
|
\() ->
|
|
|
|
quickStart
|
2019-10-22 05:11:40 +03:00
|
|
|
|> Directory.includes (Directory.withIndex () [ performance, quickStart ] [ "docs" ])
|
2019-09-15 21:46:00 +03:00
|
|
|
|> 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" ])
|
2019-09-15 21:46:00 +03:00
|
|
|
|> Expect.equal False
|
2019-09-15 22:15:49 +03:00
|
|
|
, 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" ])
|
2019-09-15 22:15:49 +03:00
|
|
|
|> Expect.equal True
|
2019-09-15 21:46:00 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
quickStart =
|
|
|
|
PagePath.build () [ "docs", "quick-start" ]
|
|
|
|
|
|
|
|
|
|
|
|
performance =
|
|
|
|
PagePath.build () [ "docs", "performance" ]
|
|
|
|
|
|
|
|
|
2019-09-15 22:15:49 +03:00
|
|
|
docsIndex =
|
|
|
|
PagePath.build () [ "docs" ]
|
|
|
|
|
|
|
|
|
2019-09-15 21:46:00 +03:00
|
|
|
notInDocsDir =
|
|
|
|
PagePath.build () [ "notInDocsDir" ]
|