def test_ts_chart_with_field_options_disabled():
    field_opt = FieldOption('bar', enabled=False)
    opt = {'fields': [field_opt.to_dict()]}
    chart = TimeSeriesChart().with_legend_options([field_opt])
    assert chart.chart_options['legendOptions'] == opt
def test_ts_chart_with_field_options():
    field_opt = FieldOption('foo')
    opt = {'fields': [field_opt.to_dict()]}
    chart = TimeSeriesChart().with_legend_options([field_opt])
    assert chart.chart_options['legendOptions'] == opt