cms/app-client/tests/integration/components/player-component-test.js
author ymh <ymh.work@gmail.com>
Fri, 02 Dec 2016 00:22:31 +0100
changeset 454 710a2ae08a74
parent 86 15ded106ef1a
permissions -rw-r--r--
rework transcript component to correct various bugs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
86
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     1
import { moduleForComponent, test } from 'ember-qunit';
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     2
import hbs from 'htmlbars-inline-precompile';
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     3
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     4
moduleForComponent('player-component', 'Integration | Component | player component', {
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     5
  integration: true
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     6
});
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     7
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     8
test('it renders', function(assert) {
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     9
  assert.expect(2);
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    10
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    11
  // Set any properties with this.set('myProperty', 'value');
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    12
  // Handle any actions with this.on('myAction', function(val) { ... });
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    13
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    14
  this.render(hbs`{{player-component}}`);
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    15
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    16
  assert.equal(this.$().text().trim(), '');
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    17
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    18
  // Template block usage:
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    19
  this.render(hbs`
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    20
    {{#player-component}}
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    21
      template block text
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    22
    {{/player-component}}
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    23
  `);
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    24
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    25
  assert.equal(this.$().text().trim(), 'template block text');
15ded106ef1a add a player component to handle sound play/pause
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    26
});