Skip to content

Commit

Permalink
Re-add creator to query validation API (metabase#47183)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnswanson authored Aug 26, 2024
1 parent 84e5008 commit 1926bf9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
(defn- present [card]
(-> card
(select-keys [:id :description :collection_id :name :entity_id :archived :collection_position
:display :collection_preview :dataset_query :last_used_at :errors :collection])
:display :collection_preview :dataset_query :last_used_at :errors :collection
:creator])
(update :collection (fn present-collection [collection]
{:id (:id collection)
:name (:name collection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,25 @@
(mt/with-premium-features #{:query-reference-validation}
(testing "The endpoint is unavailable for normal users"
(is (mt/user-http-request :rasta :get 403 url)))))

(deftest all-expected-keys-are-present
(testing "All the expected keys are present"
(with-test-setup!
(is (= (repeat 4 #{:archived
:collection
:collection_id
:collection_position
:collection_preview
:creator
:dataset_query
:description
:display
:entity_id
:errors
:id
:last_used_at
:name})
(->> (get! {})
:data
(map keys)
(map set)))))))

0 comments on commit 1926bf9

Please sign in to comment.