bellroy/elm-actor-framework-sandbox - version: 1.0.0

for more information visit the package's GitHub page

Package contains the following modules:

Elm Actor Framework - Sandbox

Build Status Elm package

This package is as an extension of the Elm Actor Framework Package.

Easily run your component as a sandboxed application, add testCases and turn them into Elm tests!

import Framework.Sandbox as Sandbox
import Framework.Sandbox.TestCase as TestCase
import Framework.Sandbox.Browser as Browser
import Component.Counter exposing (component, Model, MsgIn(..))

sandboxed: SandboxComponent Int Model MsgIn () (Html MsgIn)
sandboxed =
    Sandbox.fromComponent () component
        |> Sandbox.addTestCase
            (TestCase.make
                { title = "Increment"
                , description = "Increment the counters value by one."
                , test = \_ a b -> Expect (b - a) 1
                }
                |> TestCase.setActions [ Increment ]
            )
        |> Browser.document