   (test-persistence "col-2$nestedserie$label" {:events 5 :features 3})
   (test-timeline "col-2" "id-b" {:timeline-current {:n 1}
                                  :timeline {:n 1}
-                                 :timeline-changelog {:n-new 2 :n-change 7 :n-delete 3 :n-close 2}})
+                                 :timeline-changelog {:n-new 2 :n-change 7 :n-delete 3 :n-close 2}}
+                 (:changelog-counts results))
   (test-timeline->extract (:extracts results) 2)
   (test-geoserver "col-2" 1)
   (test-geoserver "col-2$nestedserie$label" 1))

     (is (= features (count (query "feature" (cond-> {:collection collection}
                                               feature-id (assoc :feature_id feature-id)))))))))


(defn- test-timeline [collection feature-id {:keys [timeline-current timeline timeline-changelog]}]
  (testing "!>>> Timeline"
    (is (= (:n timeline-current) (count (query "timeline_current" {:collection collection :feature_id feature-id}))))
    (is (= (:n timeline) (count (query "timeline" {:collection collection :feature_id feature-id}))))
    ;(is (= (or (:n-new timeline-changelog) 0)
    ;       (count (query "timeline_changelog" {:collection collection :action "new"}))))
    ;(is (= (or (:n-change timeline-changelog) 0)    
    ;       (count (query "timeline_changelog" {:collection collection :action "change"}))))
    ;(is (= (or (:n-close timeline-changelog) 0)
    ;       (count (query "timeline_changelog" {:collection collection :action "close"}))))
    ;(is (= (or (:n-delete timeline-changelog) 0)
    ;       (count (query "timeline_changelog" {:collection collection :action "delete"}))))
    ))

(defn- test-timeline->extract [extracts n-extracts]

  (test-persistence "col-2$nestedserie$label" {:events 1 :features 1})
  (test-timeline "col-2" "id-b" {:timeline-current {:n 1}
                                 :timeline {:n 0}
                                 :timeline-changelog {:n-new 1 :n-change 2}}
                 (:changelog-counts results))
  (test-timeline->extract (:extracts results) 1)
  (test-geoserver "col-2" 1)
  (test-geoserver "col-2$nestedserie" 0)
