Commit d4d30313 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[Test] fix tests

purs repl works now
parent d51ae155
module Gargantext.Components.NgramsTable.Spec where module Gargantext.Components.NgramsTable.Spec where
import Prelude import Prelude
import Gargantext.Config (CTabNgramType(..))
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..))
import Gargantext.Components.NgramsTable.Core (highlightNgrams, NgramsElement(..), NgramsTable(..)) import Gargantext.Components.NgramsTable.Core (highlightNgrams, NgramsElement(..), NgramsTable(..))
...@@ -41,7 +42,7 @@ spec = do ...@@ -41,7 +42,7 @@ spec = do
,Tuple " at every " Nothing ,Tuple " at every " Nothing
,Tuple "candidate" (Just CandidateTerm) ,Tuple "candidate" (Just CandidateTerm)
] ]
highlightNgrams table input `shouldEqual` output highlightNgrams CTabTerms table input `shouldEqual` output
it "works when pattern overlaps" do it "works when pattern overlaps" do
let table = NgramsTable let table = NgramsTable
...@@ -66,7 +67,7 @@ spec = do ...@@ -66,7 +67,7 @@ spec = do
,Tuple " " Nothing ,Tuple " " Nothing
,Tuple "the" (Just GraphTerm) ,Tuple "the" (Just GraphTerm)
] ]
highlightNgrams table input `shouldEqual` output highlightNgrams CTabTerms table input `shouldEqual` output
it "works when pattern overlaps 2" do it "works when pattern overlaps 2" do
let table = NgramsTable let table = NgramsTable
...@@ -80,7 +81,7 @@ spec = do ...@@ -80,7 +81,7 @@ spec = do
,Tuple " space " Nothing ,Tuple " space " Nothing
,Tuple "images" (Just GraphTerm) ,Tuple "images" (Just GraphTerm)
] ]
highlightNgrams table input `shouldEqual` output highlightNgrams CTabTerms table input `shouldEqual` output
it "works with punctuation" do it "works with punctuation" do
let table = NgramsTable let table = NgramsTable
...@@ -90,4 +91,4 @@ spec = do ...@@ -90,4 +91,4 @@ spec = do
,Tuple "graph" (Just GraphTerm) ,Tuple "graph" (Just GraphTerm)
,Tuple ", after" Nothing ,Tuple ", after" Nothing
] ]
highlightNgrams table input `shouldEqual` output highlightNgrams CTabTerms table input `shouldEqual` output
...@@ -2,9 +2,10 @@ module Test.Main where ...@@ -2,9 +2,10 @@ module Test.Main where
import Prelude import Prelude
import Effect (Effect) import Effect (Effect)
import Effect.Aff (launchAff_)
import Test.Spec.Discovery (discover) import Test.Spec.Discovery (discover)
import Test.Spec.Reporter.Console (consoleReporter) import Test.Spec.Reporter.Console (consoleReporter)
import Test.Spec.Runner (run) import Test.Spec.Runner (run)
main :: Effect Unit main :: Effect Unit
main = discover "Gargantext\\..*Spec" >>= run [consoleReporter] main = discover "Gargantext\\..*Spec" >>= run [consoleReporter] >>> launchAff_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment