Slide 46
Slide 46 text
// tests/integration/components/rental-listing-test.js
test('should toggle wide class on click', function (assert) {
let rentalObj = Ember.Object.create({
image: 'quarto-no-centro.jpg',
title: 'Quarto no Centro de Floripa'
});
this.render(hbs`{{rental-listing rental=rentalObj}}`);
assert.equal(this.$('.image.wide').length, 0,
'initially rendered small’);
this.$('.image').click();
assert.equal(this.$('.image.wide').length, 1,
'rendered wide after click');
this.$('.image').click();
assert.equal(this.$('.image.wide').length, 0,
'rendered small after second click');
});