How to use the @ember/test-helpers.blur function in @ember/test-helpers

To help you get started, we’ve selected a few @ember/test-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / ember__test-helpers / ember__test-helpers-tests.ts View on Github external
test('DOM interactions', async () => {
    await render(hbs`<div class="message">Hello, world</div>`);

    await click('.message');
    await doubleClick('.message');
    await tap('.message');
    await focus('.message');
    await blur('.message');
    await triggerEvent('.message', 'custom-event');
    await triggerKeyEvent('.message', 'keydown', 'Enter', { ctrlKey: true });
    await fillIn('.message', 'content');

    const messageElement = find('.message')!;
    await click(messageElement);
    await doubleClick(messageElement);
    await tap(messageElement);
    await focus(messageElement);
    await blur(messageElement);
    await triggerEvent(messageElement, 'custom-event');
    await triggerKeyEvent(messageElement, 'keydown', 'Enter', { ctrlKey: true });
    await fillIn(messageElement, 'content');
    await typeIn(messageElement, 'content');

    const allMessages = findAll('.message');
github ember-codemods / ember-test-helpers-codemod / transforms / acceptance / __testfixtures__ / trigger-event.output.js View on Github external
test('visiting /foo', async function(assert) {
  await visit('/foo');

  await focus('input');
  await blur('input');
  await triggerEvent('#bar', 'mouseenter');
  assert.equal(currentURL(), '/foo');
});
github ember-codemods / ember-test-helpers-codemod / transforms / integration / __testfixtures__ / set-value.output.js View on Github external
test('it renders', async function(assert) {
  this.render(hbs`{{foo-bar}}`);

  await fillIn('.foo', 'foo');
  await fillIn('.foo', 'bar');
  await blur('.foo');
  await fillIn('.foo', 'baz');
  Ember.run(async () => await fillIn('select', '1'));
  Ember.run(() => this.$('select').val('1').trigger('change'));
  Ember.run(() => this.$('#odd').val(10).trigger('input').trigger('blur'));
  this.$('#odd').val(10).trigger('input').trigger('blur');
  this.$('input:eq(0)')
    .val('foo')
    .trigger('keydown')
    .focusout();
  this.$('input:eq(0)')
    .val('foo')
    .trigger('keydown')
    .blur();
  assert.ok(true);
});
github ember-codemods / ember-test-helpers-codemod / transforms / integration / __testfixtures__ / all.output.js View on Github external
test('it renders', async function(assert) {
  this.render(hbs`{{foo-bar}}`);

  await click('.foo');
  assert.equal(find('.foo').id, 'foo');
  await fillIn('.foo input', 'bar');
  await blur('.foo input');
  assert.equal(find('.foo').textContent.trim(), 'foo');
});
github ember-codemods / ember-test-helpers-codemod / __testfixtures__ / integration / all.output.js View on Github external
test('it renders', async function(assert) {
  this.render(hbs`{{foo-bar}}`);

  await click('.foo');
  assert.equal(this.element.querySelector('.foo').id, 'foo');
  await fillIn('.foo input', 'bar');
  await blur('.foo input');
  assert.equal(this.element.querySelector('.foo').textContent.trim(), 'foo');
});
github ember-codemods / ember-test-helpers-codemod / transforms / native-dom / __testfixtures__ / integration.output.js View on Github external
test('and again', async function(assert) {
  this.render(hbs`{{foo-bar}}`);

  await tap('foo');
  let el = findWithAssert('.foo input');

  await fillIn(el, value);
  await triggerEvent('.foo input', 'change');
  await triggerKeyEvent('bar', 'keypress', 13, modifiers);

  await focus('.foo input');
  await blur('.foo input');

  assert.ok(findAll('.baz')[1].classList.contains('selected'));
});
github DefinitelyTyped / DefinitelyTyped / types / ember__test-helpers / ember__test-helpers-tests.ts View on Github external
await click('.message');
    await doubleClick('.message');
    await tap('.message');
    await focus('.message');
    await blur('.message');
    await triggerEvent('.message', 'custom-event');
    await triggerKeyEvent('.message', 'keydown', 'Enter', { ctrlKey: true });
    await fillIn('.message', 'content');

    const messageElement = find('.message')!;
    await click(messageElement);
    await doubleClick(messageElement);
    await tap(messageElement);
    await focus(messageElement);
    await blur(messageElement);
    await triggerEvent(messageElement, 'custom-event');
    await triggerKeyEvent(messageElement, 'keydown', 'Enter', { ctrlKey: true });
    await fillIn(messageElement, 'content');
    await typeIn(messageElement, 'content');

    const allMessages = findAll('.message');
    for (const element of allMessages) {
        await click(element);
    }

    const root = getRootElement();
    await click(root);
});