Removed test setter
This commit is contained in:
parent
1481bed98d
commit
d21579681c
1 changed files with 4 additions and 5 deletions
|
@ -2,16 +2,15 @@ import { module, test } from 'qunit';
|
||||||
import { setupRenderingTest } from 'ember-qunit';
|
import { setupRenderingTest } from 'ember-qunit';
|
||||||
import { render, triggerKeyEvent } from '@ember/test-helpers';
|
import { render, triggerKeyEvent } from '@ember/test-helpers';
|
||||||
import hbs from 'htmlbars-inline-precompile';
|
import hbs from 'htmlbars-inline-precompile';
|
||||||
import { set } from '@ember/object';
|
|
||||||
|
|
||||||
module('Integration | Modifier | key-up', function(hooks) {
|
module('Integration | Modifier | key-up', function(hooks) {
|
||||||
setupRenderingTest(hooks);
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
test('it fires off a function when a key is pressed, passing the event along with it', async function(assert) {
|
test('it fires off a function when a key is pressed, passing the event along with it', async function(assert) {
|
||||||
set(this, 'keyUp', ({ key }) => {
|
this.keyUp = ({ key }) => {
|
||||||
assert.step('key up');
|
assert.step('key up');
|
||||||
assert.equal(key, 'Enter');
|
assert.equal(key, 'Enter');
|
||||||
});
|
};
|
||||||
|
|
||||||
await render(hbs`
|
await render(hbs`
|
||||||
<div {{key-up this.keyUp}}
|
<div {{key-up this.keyUp}}
|
||||||
|
@ -24,10 +23,10 @@ module('Integration | Modifier | key-up', function(hooks) {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('it can listen for a specific key', async function(assert) {
|
test('it can listen for a specific key', async function(assert) {
|
||||||
set(this, 'keyUp', ({ key }) => {
|
this.keyUp = ({ key }) => {
|
||||||
assert.step('enter key up');
|
assert.step('enter key up');
|
||||||
assert.equal(key, 'Enter');
|
assert.equal(key, 'Enter');
|
||||||
});
|
};
|
||||||
|
|
||||||
await render(hbs`
|
await render(hbs`
|
||||||
<div {{key-up this.keyUp key="Enter"}}
|
<div {{key-up this.keyUp key="Enter"}}
|
||||||
|
|
Loading…
Add table
Reference in a new issue