File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
packages/forest_admin_agent/spec/lib/forest_admin_agent/builder Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -290,6 +290,31 @@ module Builder
290290 end
291291 end
292292
293+ describe 'chart (DSL method)' do
294+ it 'provides a fluent DSL for creating charts' do
295+ instance = described_class . instance
296+ allow ( instance . customizer ) . to receive ( :add_chart )
297+
298+ result = instance . chart :appointments do
299+ value 784 , 760
300+ end
301+
302+ expect ( instance . customizer ) . to have_received ( :add_chart ) . with ( 'appointments' )
303+ expect ( result ) . to eq ( instance )
304+ end
305+
306+ it 'converts symbol names to strings' do
307+ instance = described_class . instance
308+ allow ( instance . customizer ) . to receive ( :add_chart )
309+
310+ instance . chart :my_chart do
311+ value 123
312+ end
313+
314+ expect ( instance . customizer ) . to have_received ( :add_chart ) . with ( 'my_chart' )
315+ end
316+ end
317+
293318 describe 'format_schema_json' do
294319 it 'collapses single-element arrays onto one line' do
295320 instance = described_class . instance
You can’t perform that action at this time.
0 commit comments