MCPcopy
hub / github.com/pocketbase/pocketbase / TestCollectionIsView

Function TestCollectionIsView

core/collection_model_test.go:381–404  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

379}
380
381func TestCollectionIsView(t *testing.T) {
382 t.Parallel()
383
384 scenarios := []struct {
385 typ string
386 expected bool
387 }{
388 {"unknown", false},
389 {core.CollectionTypeBase, false},
390 {core.CollectionTypeView, true},
391 {core.CollectionTypeAuth, false},
392 }
393
394 for _, s := range scenarios {
395 t.Run(s.typ, func(t *testing.T) {
396 c := core.Collection{}
397 c.Type = s.typ
398
399 if v := c.IsView(); v != s.expected {
400 t.Fatalf("Expected %v, got %v", s.expected, v)
401 }
402 })
403 }
404}
405
406func TestCollectionIsAuth(t *testing.T) {
407 t.Parallel()

Callers

nothing calls this directly

Calls 2

IsViewMethod · 0.95
RunMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…