MCPcopy Create free account
hub / github.com/daodst/chat / TestFlowCheckingExtraneousUnordered

Function TestFlowCheckingExtraneousUnordered

clientapi/routing/register_test.go:103–114  ·  view source on GitHub ↗

Should return true as we complete all stages of an allowed flow, though out of order, as well as extraneous stages.

(t *testing.T)

Source from the content-addressed store, hash-verified

101// Should return true as we complete all stages of an allowed flow, though out
102// of order, as well as extraneous stages.
103func TestFlowCheckingExtraneousUnordered(t *testing.T) {
104 testFlow := []authtypes.LoginType{
105 authtypes.LoginType("stage5"),
106 authtypes.LoginType("stage4"),
107 authtypes.LoginType("stage3"),
108 authtypes.LoginType("stage2"),
109 authtypes.LoginType("stage1"),
110 }
111 if !checkFlowCompleted(testFlow, allowedFlows) {
112 t.Error("Incorrect registration flow verification: ", testFlow, ", from allowed flows: ", allowedFlows, ". Should be true.")
113 }
114}
115
116// Should return false as we're providing fewer stages than are required.
117func TestFlowCheckingShortIncorrectInput(t *testing.T) {

Callers

nothing calls this directly

Calls 2

checkFlowCompletedFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected