Skip to content

Commit

Permalink
Fix test checker
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkerlucio committed Aug 24, 2024
1 parent 671b263 commit 5791ad6
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions test/com/wsscode/pathom3/connect/runner_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -2927,16 +2927,17 @@
:y 20}))))

(deftest run-graph!-placeholders-test
(is (check-serial (pci/register (pbir/constantly-resolver :foo "bar"))
{}
[{:>/path [:foo]}]
{:>/path {:foo "bar"}}))
(check-all-runners
(pci/register (pbir/constantly-resolver :foo "bar"))
{}
[{:>/path [:foo]}]
{:>/path {:foo "bar"}})

(is (graph-response? (pci/register (pbir/constantly-resolver :foo "bar"))
{:foo "baz"}
[{:>/path [:foo]}]
{:foo "baz"
:>/path {:foo "baz"}}))
(check-all-runners (pci/register (pbir/constantly-resolver :foo "bar"))
{:foo "baz"}
[{:>/path [:foo]}]
{:foo "baz"
:>/path {:foo "baz"}})

(testing "keep split when placeholder uses different parameters"
(check-all-runners
Expand All @@ -2962,20 +2963,21 @@
{:>/a {:x "foo - 1"}, :>/b {:x "foo - 2"}}))

(testing "with batch"
(is (graph-response? (pci/register
[(pco/resolver 'batch
{::pco/batch? true
::pco/input [:x]
::pco/output [:y]}
(fn [_ xs]
(mapv #(array-map :y (inc (:x %))) xs)))])
{:x 10}
'[:y
{:>/go [:y]}]
{:x 10
:y 11
:>/go {:x 10
:y 11}})))
(check-all-runners
(pci/register
[(pco/resolver 'batch
{::pco/batch? true
::pco/input [:x]
::pco/output [:y]}
(fn [_ xs]
(mapv #(array-map :y (inc (:x %))) xs)))])
{:x 10}
'[:y
{:>/go [:y]}]
{:x 10
:y 11
:>/go {:x 10
:y 11}}))

(testing "placeholder-data-params"
(check-all-runners
Expand Down

0 comments on commit 5791ad6

Please sign in to comment.