MCPcopy Index your code
hub / github.com/pocketbase/pocketbase / TestFindFirstRecordByData

Function TestFindFirstRecordByData

core/record_query_test.go:501–572  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

499}
500
501func TestFindFirstRecordByData(t *testing.T) {
502 t.Parallel()
503
504 app, _ := tests.NewTestApp()
505 defer app.Cleanup()
506
507 scenarios := []struct {
508 collectionIdOrName string
509 key string
510 value any
511 expectId string
512 expectError bool
513 }{
514 {
515 "missing",
516 "id",
517 "llvuca81nly1qls",
518 "llvuca81nly1qls",
519 true,
520 },
521 {
522 "demo2",
523 "",
524 "llvuca81nly1qls",
525 "",
526 true,
527 },
528 {
529 "demo2",
530 "invalid_or_missing",
531 "llvuca81nly1qls",
532 "",
533 true,
534 },
535 {
536 "demo2",
537 "id",
538 "invalid",
539 "",
540 true,
541 },
542 {
543 "demo2",
544 "id",
545 "llvuca81nly1qls",
546 "llvuca81nly1qls",
547 false,
548 },
549 {
550 "sz5l5z67tg7gku0",
551 "title",
552 "test3",
553 "0yxhwia2amd8gec",
554 false,
555 },
556 }
557
558 for i, s := range scenarios {

Callers

nothing calls this directly

Calls 4

CleanupMethod · 0.95
NewTestAppFunction · 0.92
FindFirstRecordByDataMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…