                           2 {:id 2 :page 1 :group 3}
                           3 {:id 3 :page 1 :type :group}}}
 
-        expected (-> initial
-                     (assoc-in [:workspace :selected] #{4})
-                     (assoc-in [:pages 1 :shapes] [1 3])
-                     (assoc-in [:shapes 2 :group] 4)
-                     (assoc-in [:shapes 3 :items] [4])
-                     (assoc-in [:shapes 4] {:type :group :name "Group-1"
-                                            :items [2] :id 4 :page 1 :group 3}))]
+        expected {:pages {1 {:id 1 :shapes [1 3]}}
+                  :shapes {1 {:id 1 :page 1}
+                           2 {:id 2 :page 1 :group 4}
+                           3 {:id 3 :page 1 :type :group :items [4]}
+                           4 {:type :group
+                              :name "Group-1"
+                              :items [2]
+                              :id 4
+                              :page 1
+                              :group 3}}
+                  :workspace {:selected #{4}}}]
     (with-redefs [uxbox.util.uuid/random (constantly 4)]
       (let [result (impl/group-shapes initial [2] 1)]
         ;; (pprint expected)

                                2 {:id 2 :page 1}
                                3 {:id 3 :page 1}}}

        expected (-> initial
                     (assoc-in [:workspace :selected] #{4})
                     (assoc-in [:pages 1 :shapes] [1 4])
                     (assoc-in [:shapes 2 :group] 4)
                     (assoc-in [:shapes 3 :group] 4)
                     (assoc-in [:shapes 4] {:type :group :name "Group-1"
                                            :items [2 3] :id 4 :page 1}))]
    (with-redefs [uxbox.util.uuid/random (constantly 4)]
      (let [result (impl/group-shapes initial [2 3] 1)]
        ;; (pprint expected)
        ;; (pprint result)
        (t/is (= result expected))))))


;; group group
(t/deftest group-shapes-3
  (let [initial {:pages {1 {:id 1 :shapes [1 2 3]}}
                 :shapes {1 {:id 1 :page 1}
                          2 {:id 2 :page 1}
                          3 {:id 3 :page 1 :type :group}}}

        expected (-> initial
                     (assoc-in [:workspace :selected] #{4})
                     (assoc-in [:pages 1 :shapes] [1 4])
                     (assoc-in [:shapes 2 :group] 4)
                     (assoc-in [:shapes 3 :group] 4)
                     (assoc-in [:shapes 4] {:type :group :name "Group-1"
                                            :items [2 3] :id 4 :page 1}))]
    (with-redefs [uxbox.util.uuid/random (constantly 4)]
      (let [result (impl/group-shapes initial [2 3] 1)]
        ;; (pprint expected)

                                3 {:id 3 :page 1}}}
        expected (assoc-in initial [:pages 1 :shapes] [1 3 2])
        result (impl/drop-shape initial 3 1 :after)]
    ;; (pprint expected)
    ;; (pprint result)
    (t/is (= result expected))
    (t/is (vector? (get-in result [:pages 1 :shapes])))))

