var StyleShapePropertiesFormModel = require('../../../../../../javascripts/cartodb3/editor/style/style-form/style-properties-form/style-shape-properties-form-model');

describe('editor/style/style-form/style-shape-properties-form-model', function () {
  describe('.parse', function () {
    beforeEach(function () {
      this.generateData = function (styleType, geometryType) {
        return {
          type: styleType,
          geom: {
            getSimpleType: function () {
              return geometryType;
            }
          },
          fill: {
            size: {
              fixed: 10
            },
            color: {
              fixed: 'red'
            }
          },
          stroke: {
            size: {
              fixed: 10
            },
            color: {
              fixed: 'white'
            }
          },
          blending: 'none'
        };
      };
    });

    it('should not provide fill size if geometry type is polygon or style aggregated', function () {
      var attrs = StyleShapePropertiesFormModel.prototype.parse(
        this.generateData('squares', 'point')
      );
      expect(attrs.fill.size).not.toBeDefined();

      attrs = StyleShapePropertiesFormModel.prototype.parse(
        this.generateData('simple', 'polygon')
      );
      expect(attrs.fill.size).not.toBeDefined();

      attrs = StyleShapePropertiesFormModel.prototype.parse(
        this.generateData('simple', 'point')
      );
      expect(attrs.fill.size).toBeDefined();
    });

    it('should not provide fill if geometry type is line', function () {
      var attrs = StyleShapePropertiesFormModel.prototype.parse(
        this.generateData('simple', 'polygon')
      );
      expect(attrs.fill).toBeDefined();

      attrs = StyleShapePropertiesFormModel.prototype.parse(
        this.generateData('simple', 'line')
      );
      expect(attrs.fill).not.toBeDefined();
    });

    it('should not provide stroke and blending if type is heatmap', function () {
      var attrs = StyleShapePropertiesFormModel.prototype.parse(
        this.generateData('heatmap', 'point')
      );
      expect(attrs.stroke).not.toBeDefined();
      expect(attrs.blending).not.toBeDefined();
      expect(attrs.fill).toBeDefined();
    });
  });
});

@@ -871,16 +871,42 @@
 : 'none'
+,%0A          resolution: 12
 %0A       
@@ -1759,32 +1759,82 @@
 ).toBeDefined();
+%0A      expect(attrs.resolution).not.toBeDefined();
 %0A%0A      attrs = 
@@ -1969,32 +1969,82 @@
 .toBeDefined();%0A
+      expect(attrs.resolution).not.toBeDefined();%0A
     %7D);%0A%0A    it(
@@ -2364,32 +2364,78 @@
 .toBeDefined();%0A
+      expect(attrs.resolution).toBeDefined();%0A
     %7D);%0A  %7D);%0A%7D)

Test parse resolution.