diff --git a/src/test_helpers/component.cljs b/src/test_helpers/component.cljs index 8355e7e2de5d..8a67df9818b2 100644 --- a/src/test_helpers/component.cljs +++ b/src/test_helpers/component.cljs @@ -1,12 +1,12 @@ (ns test-helpers.component "Helpers for writing component tests using React Native Testing Library." - (:require-macros [test-helpers.component]) - (:require ["@testing-library/react-native" :as rtl] - [camel-snake-kebab.core :as camel-snake-kebab] - [oops.core :as oops] - [quo.theme :as quo.theme] - [reagent.core :as reagent] - [utils.i18n :as i18n])) + (:require-macros test-helpers.component) + (:require + ["@testing-library/react-native" :as rtl] + [camel-snake-kebab.core :as camel-snake-kebab] + [quo.theme :as quo.theme] + [reagent.core :as reagent] + [utils.i18n :as i18n])) ;;;; React Native Testing Library @@ -233,21 +233,3 @@ ([element prop] (has-prop element prop js/undefined)) ([element prop value] (.toHaveProp (js/expect element) (camel-snake-kebab/->camelCaseString prop) value))) - -(defn get-rerender-fn - "Rerenders a component. - Takes a JS Object representing a component and returns a function that accepts hiccup - representing the component to rerender with, optionally, the new props. - e.g. - (let [rerender-fn (h/get-rerender-fn - (h/render [my-component {:prop-1 :A - :prop-2 :B}]))] - ;; Rerenders `my-component` with the new props - (rerender-fn [my-component {:prop-1 :new-A - :prop-2 :new-B}])) - " - [component] - (fn [component-updated] - (let [rerender-fn (oops/oget component "rerender") - react-element (reagent/as-element component-updated)] - (rerender-fn react-element))))