summaryrefslogtreecommitdiff
path: root/internal/server/repository/pending_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-09-12 22:52:55 +0300
committerPaul Buetow <paul@buetow.org>2024-09-12 22:53:21 +0300
commit608f9a54cef4f081bfa245fec27e49bc237820eb (patch)
treefd575336538f2bba3da07d5b78200affbb5cc619 /internal/server/repository/pending_test.go
parentc8bc93c24bc392287bbce65222360f740cb11814 (diff)
use pending.next to determine next
Diffstat (limited to 'internal/server/repository/pending_test.go')
-rw-r--r--internal/server/repository/pending_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/server/repository/pending_test.go b/internal/server/repository/pending_test.go
index 44fe84c..28563a6 100644
--- a/internal/server/repository/pending_test.go
+++ b/internal/server/repository/pending_test.go
@@ -46,3 +46,21 @@ func TestPendingDelete(t *testing.T) {
t.Error("expected not an ok", entries)
}
}
+
+func TestPendingNext(t *testing.T) {
+ pending := newPending()
+
+ id, ok := pending.next(types.LinkedIn)
+ if ok {
+ t.Error("not expected ok return status", id)
+ }
+
+ pending.add(types.LinkedIn, "fooid")
+ id, ok = pending.next(types.LinkedIn)
+ if !ok {
+ t.Error("expected ok return status")
+ }
+ if id != "fooid" {
+ t.Error("expected entry ID fooid")
+ }
+}