-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/408-add-regional-selector' of github.com:geeksfors…
…ocialchange/the-trans-dimension into feat/408-add-regional-selector
- Loading branch information
Showing
15 changed files
with
91 additions
and
857 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"tools": { | ||
"elm": "0.19.1", | ||
"elm-format": "0.8.5", | ||
"elm-test-rs": "2.0.0" | ||
"elm-format": "0.8.7", | ||
"elm-test-rs": "3.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,60 @@ | ||
module Page.AboutTests exposing (..) | ||
|
||
import Expect | ||
import Html | ||
import Page.About exposing (view) | ||
import Path | ||
import Test exposing (Test, describe, test) | ||
import Test.Html.Query as Query | ||
import Test.Html.Selector as Selector | ||
import TestFixtures exposing (sharedModelInit) | ||
import TestUtils exposing (queryFromStyledList) | ||
|
||
|
||
viewParamsWithAbout = | ||
{ data = | ||
{ main = | ||
{ title = "About Page Test Title" | ||
, subtitle = "Test subtitle here." | ||
, body = [] | ||
} | ||
, accessibility = | ||
{ title = "Accessibility" | ||
, subtitle = "Accessibility is good for everyone" | ||
, body = [] | ||
} | ||
, makers = | ||
[ { name = "Makername", url = "google.com", logo = "logo.png", body = [] } ] | ||
, placecal = | ||
{ title = "PlaceCal lives here" | ||
, subtitleimg = "img.jpeg" | ||
, subtitleimgalt = "PlaceCal logo" | ||
, body = [] | ||
} | ||
} | ||
, path = Path.fromString "about" | ||
, routeParams = {} | ||
, sharedData = () | ||
} | ||
import TestUtils exposing (queryFromStyled) | ||
import Theme.Page.About | ||
import Theme.TransMarkdown | ||
|
||
|
||
introMarkdown = | ||
"# About us" | ||
|> Theme.TransMarkdown.markdownToBlocks | ||
|> fromResult | ||
|
||
viewBodyHtml viewParams = | ||
queryFromStyledList | ||
(view Nothing sharedModelInit viewParams).body | ||
|
||
fromResult markdownResult = | ||
case markdownResult of | ||
Ok markdownBlocks -> | ||
markdownBlocks | ||
|
||
Err _ -> | ||
[] | ||
|
||
|
||
sectionData = | ||
{ accessibilityData = | ||
{ title = "Accessibility" | ||
, subtitle = "Accessibility is good for everyone" | ||
, body = [] | ||
} | ||
, makersData = | ||
[ { name = "Makername", url = "google.com", logo = "logo.png", body = [] } ] | ||
, aboutPlaceCalData = | ||
{ title = "PlaceCal lives here" | ||
, subtitleimg = "img.jpeg" | ||
, subtitleimgalt = "PlaceCal logo" | ||
, body = [] | ||
} | ||
} | ||
|
||
|
||
suite : Test | ||
suite = | ||
describe "About page body" | ||
[ test "Has expected h2 heading" <| | ||
describe "About page" | ||
[ test "Has an intro" <| | ||
\_ -> | ||
Theme.Page.About.viewIntro introMarkdown | ||
|> queryFromStyled | ||
|> Query.find [ Selector.tag "h1" ] | ||
|> Query.contains [ Html.text "About us" ] | ||
, test "Has sections" <| | ||
\_ -> | ||
viewBodyHtml viewParamsWithAbout | ||
|> Query.find [ Selector.tag "h2" ] | ||
|> Query.contains [ Html.text "About Page Test Title" ] | ||
Theme.Page.About.viewSections sectionData | ||
|> queryFromStyled | ||
|> Query.findAll [ Selector.tag "h3" ] | ||
|> Query.count (Expect.equal 3) | ||
] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.