MCPcopy Create free account
hub / github.com/buggregator/server / TestHandler_Handle_Cookies

Function TestHandler_Handle_Cookies

modules/httpdumps/handler_test.go:111–129  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

109}
110
111func TestHandler_Handle_Cookies(t *testing.T) {
112 h := &handler{}
113 r := httptest.NewRequest("GET", "/", nil)
114 r.Header.Set("Cookie", "session=abc123; theme=dark")
115
116 inc, err := h.Handle(r)
117 if err != nil {
118 t.Fatal(err)
119 }
120
121 var payload map[string]any
122 json.Unmarshal(inc.Payload, &payload)
123
124 req, _ := payload["request"].(map[string]any)
125 cookies, _ := req["cookies"].(map[string]any)
126 if cookies["session"] != "abc123" {
127 t.Errorf("cookies.session = %v", cookies["session"])
128 }
129}
130
131func TestPreviewMapper(t *testing.T) {
132 m := &previewMapper{}

Callers

nothing calls this directly

Calls 1

HandleMethod · 0.95

Tested by

no test coverage detected