wasp/waspc/test/WaspTest.hs
2020-02-20 12:30:58 +01:00

26 lines
810 B
Haskell

module WaspTest where
import Test.Tasty.Hspec
import Wasp
import qualified Fixtures as F
spec_getEntityFormsForEntity :: Spec
spec_getEntityFormsForEntity = do
let waspWithEntityForm = fromWaspElems
[ WaspElementEntity F.taskEntity
, WaspElementEntityForm F.taskCreateForm
]
let waspWithoutEntityForm = fromWaspElems
[ WaspElementEntity F.taskEntity
]
it "When given Wasp record which contains an entity-form for a given entity, returns it." $ do
getEntityFormsForEntity waspWithEntityForm F.taskEntity
`shouldBe` [F.taskCreateForm]
it "When given Wasp record without an entity-form for a given entity, returns Nothing." $ do
getEntityFormsForEntity waspWithoutEntityForm F.taskEntity `shouldBe` []