Skip to content
Snippets Groups Projects
Commit af455a3a authored by Ryan Senior's avatar Ryan Senior
Browse files

Fix bug where pulses special_type DateTimes are recognized

Just a typo in the typechecking code that looks at the cell's
base_type for type/DateTime and not it's special_type as well. This
commit fixes that and adds a test for it.
parent bc370406
Branches
Tags
No related merge requests found
......@@ -89,8 +89,8 @@
(defn- datetime-field?
[field]
(or (isa? (:base_type field) :type/DateTime)
(isa? (:base_type field) :type/DateTime)))
(or (isa? (:base_type field) :type/DateTime)
(isa? (:special_type field) :type/DateTime)))
(defn- number-field?
[field]
......
......@@ -121,3 +121,13 @@
(let [html-output (html (render-truncation-warning 10 100 100 10))]
[(boolean (re-find #"Showing.*10.*of.*100.*columns" html-output))
(boolean (re-find #"Showing .* of .* rows" html-output))]))
(def ^:private test-columns-with-date-special-type
(update test-columns 2 merge {:base_type :type/Text
:special_type :type/DateTime}))
(expect
[{:bar-width nil, :row ["1" "34.10" "Apr 1, 2014" "Stout Burgers & Beers"]}
{:bar-width nil, :row ["2" "34.04" "Dec 5, 2014" "The Apple Pan"]}
{:bar-width nil, :row ["3" "34.05" "Aug 1, 2014" "The Gorbals"]}]
(rest (prep-for-html-rendering test-columns-with-date-special-type test-data nil nil (count test-columns))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment