Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed May 11, 2020
1 parent 12709eb commit 910e4e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/Neuron/Zettelkasten/Query/ParserSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ where
import Data.Default (def)
import Data.Some
import Data.TagTree
import Neuron.Markdown
import Neuron.Zettelkasten.Connection
import Neuron.Zettelkasten.ID
import Neuron.Zettelkasten.Query
import Neuron.Zettelkasten.Query.Parser
import Neuron.Zettelkasten.Query.Theme
import Relude
import Test.Hspec
import Text.MMark.MarkdownLink
import Text.URI

spec :: Spec
Expand Down
7 changes: 4 additions & 3 deletions test/Neuron/Zettelkasten/ZettelSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ where
import Data.Aeson
import Data.TagTree
import Data.Time.Calendar
import Neuron.Markdown
import Neuron.Zettelkasten.ID
import Neuron.Zettelkasten.Zettel
import Neuron.Zettelkasten.Zettel.Meta (Meta)
import Relude
import Rib.Parser.MMark (parsePure)
import Test.Hspec

spec :: Spec
spec = do
describe "sortZettelsReverseChronological" $ do
let mkDay = fromGregorian 2020 3
dummyContent = either error id $ parsePure "<spec>" "Dummy"
(_ :: Meta, dummyContent) = either error id $ parseMarkdown "<spec>" "Dummy"
mkZettel day idx =
Zettel (ZettelDateID (mkDay day) idx) "Some title" [Tag "science", Tag "journal/class"] (Just $ mkDay day) dummyContent
it "sorts correctly" $ do
Expand All @@ -30,7 +31,7 @@ spec = do
describe "Zettel JSON" $ do
let day = fromGregorian 2020 3 19
zid = ZettelCustomID "Foo-Bar"
dummyContent = either error id $ parsePure "<spec>" "Dummy"
(_ :: Meta, dummyContent) = either error id $ parseMarkdown "<spec>" "Dummy"
zettel = Zettel zid "Some title" [Tag "science", Tag "journal/class"] (Just day) dummyContent
it "Produces expected json" $ do
-- "{\"id\":\"2011401\",\"title\":\"Some title\",\"tags\":[\"science\"]}"
Expand Down

0 comments on commit 910e4e5

Please sign in to comment.