 (let [app-state (-> person-db
                   (f/init-form Phone [:phone/by-id 1])
                   (f/init-form Phone [:phone/by-id 2])
-                  (f/init-form Person [:people/by-id 1])
+                  (f/init-form Person [:people/by-id 7])
                   (f/init-form Person [:people/by-id 3])
                   (f/init-form PolyPerson [:people/by-id 4])
                   (f/init-form PolyPerson [:people/by-id 5])
                   (f/init-form PolyPerson [:people/by-id 6]))
       basic-person (get-in app-state [:people/by-id 3])
-      one-number-person (get-in app-state [:people/by-id 1])
+      one-number-person (get-in app-state [:people/by-id 7])
       no-number-person (get-in app-state [:people/by-id 5])
       many-number-person (get-in app-state [:people/by-id 4])
       one-many-number-person (get-in app-state [:people/by-id 6])

          "defaults as a to-many relation"
          (:input/cardinality f) => :many
          "is marked as a subform"
          (true? (:input/is-form? f)) => true
          "has a subform selection key"
          (:input/select-key f) => :k
          "has the correct type"


    (assertions
      "Just returns the unmodified app state"
      (f/init-form person-db Person [:people/by-id 7]) => person-db))
  (provided "when the form is partially initialized (to-one)"
    (f/initialized? f) => (boolean (:person/name f))

    (let [result (f/init-form person-db Person [:people/by-id 7])]
      (assertions
        "still initializes the nested form"
        (f/form-ident (get-in result [:phone/by-id 1])) => [:phone/by-id 1])))
  (provided "when the form is partially initialized (to-many)"
    (f/initialized? f) => (= 4 (:db/id f))

    (let [result (f/init-form person-db PolyPerson [:people/by-id 4])]
      (assertions
        "still initializes the nested form"
        (f/form-ident (get-in result [:phone/by-id 1])) => [:phone/by-id 1]
        (f/form-ident (get-in result [:phone/by-id 2])) => [:phone/by-id 2])))
  (let [actual (f/init-form person-db Person [:people/by-id 7])]
    (assertions
      "properly initializes a nested to-one form (integration)"
      (f/form-ident (get-in actual [:people/by-id 7])) => [:people/by-id 7]
      (f/form-ident (get-in actual [:phone/by-id 1])) => [:phone/by-id 1]))
  (let [actual (f/init-form person-db PolyPerson [:people/by-id 4])]
    (assertions
      "properly initializes a nested to-many form (integration)"
      (f/form-ident (get-in actual [:people/by-id 4])) => [:people/by-id 4]
      (f/form-ident (get-in actual [:phone/by-id 1])) => [:phone/by-id 1]
      (f/form-ident (get-in actual [:phone/by-id 2])) => [:phone/by-id 2])))

(defui LeafForm
  static uc/InitialAppState
