MCPcopy
hub / github.com/authgear/authgear-server / TestApplyRunEffects

Function TestApplyRunEffects

pkg/lib/authenticationflow/effect_test.go:11–64  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestApplyRunEffects(t *testing.T) {
12 Convey("ApplyRunEffects", t, func() {
13 test := func(w *Flow, expectedEffect string) {
14 var buf strings.Builder
15 ctx := context.Background()
16 ctx = WithEffectWriter(ctx, &buf)
17 deps := &Dependencies{}
18 err := ApplyRunEffects(ctx, deps, NewFlows(w))
19 So(err, ShouldBeNil)
20 So(buf.String(), ShouldEqual, expectedEffect)
21 }
22
23 test(&Flow{
24 FlowID: "wf-0",
25 StateToken: "wf-0-state-0",
26 Intent: &testMarshalIntent0{
27 Intent0: "intent0-0",
28 },
29 Nodes: []Node{
30 Node{
31 Type: NodeTypeSimple,
32 Simple: &testMarshalNode0{
33 Node0: "node0-0",
34 },
35 },
36 Node{
37 Type: NodeTypeSubFlow,
38 SubFlow: &Flow{
39 Intent: &testMarshalIntent0{
40 Intent0: "intent0-1",
41 },
42 Nodes: []Node{
43 Node{
44 Type: NodeTypeSimple,
45 Simple: &testMarshalNode0{
46 Node0: "node0-1",
47 },
48 },
49 },
50 },
51 },
52 Node{
53 Type: NodeTypeSimple,
54 Simple: &testMarshalNode0{
55 Node0: "node0-2",
56 },
57 },
58 },
59 }, `run-effect: node0-0
60run-effect: node0-1
61run-effect: node0-2
62`)
63 })
64}
65
66func TestApplyAllEffects(t *testing.T) {
67 Convey("ApplyAllEffects", t, func() {

Callers

nothing calls this directly

Calls 5

ApplyRunEffectsFunction · 0.85
NewFlowsFunction · 0.85
testFunction · 0.85
WithEffectWriterFunction · 0.70
StringMethod · 0.65

Tested by

no test coverage detected