import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('cartodb-layer', 'Integration | Component | cartodb layer', {
  integration: true
});

test('it renders', function(assert) {
  // Set any properties with this.set('myProperty', 'value');
  // Handle any actions with this.on('myAction', function(val) { ... });

  this.render(hbs`{{cartodb-layer}}`);

  assert.equal(this.$().text().trim(), '');

  // Template block usage:
  this.render(hbs`
    {{#cartodb-layer}}
      template block text
    {{/cartodb-layer}}
  `);

  assert.equal(this.$().text().trim(), 'template block text');
});

@@ -94,16 +94,112 @@
 ompile';
+%0Aimport CartodbLayerComponent from 'ember-leaflet-cartodb/components/cartodb-layer';%0A%0Avar layer;
 %0A%0Amodule
@@ -296,457 +296,764 @@
 true
-%0A%7D);%0A%0Atest('it renders', function(assert) %7B%0A  // Set any properties with this.set('myProperty', 'value');%0A  // Handle any actions with this.on('myAction', function(val) %7B ... %7D);%0A%0A  this.render(hbs%60%7B%7Bcartodb-layer%7D%7D%60);%0A%0A  assert.equal(this.$().text().trim(), '');%0A%0A  // Template block usage:%0A  this.render(hbs%60%0A    %7B%7B#cartodb-layer%7D%7D%0A      template block text%0A    %7B%7B/cartodb-layer%7D%7D%0A  %60);%0A%0A  assert.equal(this.$().text().trim(), 'template block text
+,%0A  beforeEach() %7B%0A    this.register('component:cartodb-layer', CartodbLayerComponent.extend(%7B%0A      init() %7B%0A        this._super(...arguments);%0A        layer = this;%0A      %7D%0A    %7D));%0A  %7D%0A%7D);%0A%0Atest('it renders', function(assert) %7B%0A  // Set any properties with this.set('myProperty', 'value');%0A  // Handle any actions with this.on('myAction', function(val) %7B ... %7D);%0A%0A  this.setProperties(%7B%0A    lat: 42.33012354634199,%0A    lng: -70.95623016357422,%0A    zoom: 4,%0A    cartoUrl: 'http://nacis-workshop.cartodb.com/api/v2/viz/569d1940-336d-11e3-af98-5f54611e93d5/viz.json'%0A  %7D);%0A%0A  this.render(hbs%60%0A    %7B%7B#leaflet-map lat=lat lng=lng zoom=zoom%7D%7D%0A      %7B%7Bcartodb-layer url=cartoUrl%7D%7D%0A    %7B%7B/leaflet-map%7D%7D%0A  %60);%0A%0A  assert.ok(layer._layer, 'has layer object defined
 ');%0A

Add integration test