MCPcopy Index your code
hub / github.com/coder/coder / TestNoopWebpusher

Function TestNoopWebpusher

coderd/webpush/webpush_test.go:548–564  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

546}
547
548func TestNoopWebpusher(t *testing.T) {
549 t.Parallel()
550
551 noop := &webpush.NoopWebpusher{
552 Msg: "push disabled",
553 }
554
555 dispatchErr := noop.Dispatch(context.Background(), uuid.New(), codersdk.WebpushMessage{})
556 require.Error(t, dispatchErr)
557 require.Contains(t, dispatchErr.Error(), "push disabled")
558
559 testErr := noop.Test(context.Background(), codersdk.WebpushSubscription{})
560 require.Error(t, testErr)
561 require.Contains(t, testErr.Error(), "push disabled")
562
563 require.Empty(t, noop.PublicKey())
564}
565
566// TestSSRFPrevention verifies that the default SSRF-safe HTTP client blocks
567// webpush delivery to loopback (and other non-public) addresses. This

Callers

nothing calls this directly

Calls 7

DispatchMethod · 0.95
TestMethod · 0.95
PublicKeyMethod · 0.95
NewMethod · 0.65
ErrorMethod · 0.45
ContainsMethod · 0.45
EmptyMethod · 0.45

Tested by

no test coverage detected