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

moduleForComponent('b-portion', 'Integration | Component | b portion', {
  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`{{b-portion}}`);

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

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

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

@@ -198,182 +198,193 @@
 );%0A%0A
-test('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
+const portionStub = Ember.Object.create(%7B%0A  cost: 42,%0A  text: 'hi',%0A  paid: false,%0A  save() %7B%7D%0A%7D);%0A%0Atest('should render portion', function(assert) %7B%0A  this.set('portion', portionStub
 );%0A
-%0A
   th
@@ -408,16 +408,32 @@
 -portion
+ portion=portion
 %7D%7D%60);%0A%0A 
@@ -457,57 +457,193 @@
 s.$(
-).text().trim
+'.b-portion__cost').text(), '42');%0A  assert.equal(this.$('.b-portion__text').text
 (), '
+hi
 ');%0A
-%0A  // Template block usage:
+%7D);%0A%0Atest('should toggle paid status', function(assert) %7B%0A  this.set('portion', portionStub);
 %0A  t
@@ -661,16 +661,10 @@
 hbs%60
-%0A    
 %7B%7B
-#
 b-po
@@ -672,59 +672,54 @@
 tion
-%7D%7D%0A      template block text%0A    %7B%7B/b-portion%7D%7D%0A  %60
+ portion=portion%7D%7D%60);%0A  this.$('input').click(
 );%0A%0A
@@ -731,59 +731,35 @@
 ert.
-equal
+ok
 (this.
-$().text().trim(), 'template block text'
+get('portion.paid')
 );%0A%7D

Add b-portion test suite