Пример #1
0
      it('should return the valid widget types for date columns', function () {
        this.querySchemaModel.columnsCollection.reset([
          { name: 'year', type: 'date' }
        ]);

        var types = WidgetsFormFactory.getDataTypes(this.querySchemaModel);
        var values = _.pluck(types, 'value');
        expect(values.sort()).toEqual(['category', 'time-series']);
      });
Пример #2
0
      it('should return the valid widget types for string columns', function () {
        this.querySchemaModel.columnsCollection.reset([
          { name: 'cartodb_id', type: 'string' },
          { name: 'nobel_prizes_winners', type: 'string' },
          { name: 'year', type: 'string' }
        ]);

        var types = WidgetsFormFactory.getDataTypes(this.querySchemaModel);
        var values = _.pluck(types, 'value');
        expect(values.sort()).toEqual(['category']);
      });