Skip to content

Commit

Permalink
(red) wip on offers
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxWilson committed Jan 5, 2024
1 parent 3878da5 commit c04135e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/Chargen.Accept.fs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ type OfferInput = {
selected: Set<Key>
}
with static member fresh = { selected = Set.empty }
type 't Offer = Offer of (OfferInput -> 't)
type 't ListOffer = ('t list) Offer
type 't OptionOffer = ('t option) Offer

type OfferConfig = {
key: Key option
label: string option
}
with static member blank = { key = None; label = None }
type 't Offer = { config: OfferConfig; func: (OfferConfig -> OfferInput -> 't) }
with member this.recur input = this.func this.config input
type 't ListOffer = ('t list) Offer
type 't OptionOffer = ('t option) Offer

open type OfferConfig

type 'reactElement RenderApi = {
Expand Down Expand Up @@ -155,6 +156,10 @@ let pseudoReactApi = {
combine = Fragment
}

[<Tests>]
let unit1 = testCase "Unit.Chargen.smoke1" <| fun () ->
test <@ [either(trait' "Fight", trait' "Hide")] |> evaluate OfferInput.fresh = Either(None, [false, Leaf "Fight"; false, Leaf "Hide"]) @>

let proto1 = testCase "proto1" <| fun () ->
let actual = swash() |> evaluate OfferInput.fresh // shouldn't actually use OfferInput.fresh here. Need to pick the options we want to show up in pseudoActual.s
let pseudoActual = // pseudo-actual because actual will be created from templates + OfferInput (i.e. selected keys), not hardwired as Menus, but that's still TODO
Expand Down

0 comments on commit c04135e

Please sign in to comment.