Sha256: 7fbc90cbed3ee2fa62c436e907569ee4c9fcd05c50cdf6b75a120236d2693b19

Contents?: true

Size: 832 Bytes

Versions: 3

Compression:

Stored size: 832 Bytes

Contents

import { compile } from '../../index';
import { moduleFor, AbstractTestCase } from 'internal-test-helpers';

const EVENTS = [
  'insert-newline',
  'enter',
  'escape-press',
  'focus-in',
  'focus-out',
  'key-press',
  'key-up',
  'key-down',
];

class DeprecateSendActionTest extends AbstractTestCase {}

EVENTS.forEach(function(e) {
  DeprecateSendActionTest.prototype[
    `@test Using \`{{input ${e}="actionName"}}\` provides a deprecation`
  ] = function() {
    let expectedMessage = `Please refactor \`{{input ${e}="foo-bar"}}\` to \`{{input ${e}=(action "foo-bar")}}\. ('baz/foo-bar' @ L1:C0) `;

    expectDeprecation(() => {
      compile(`{{input ${e}="foo-bar"}}`, { moduleName: 'baz/foo-bar' });
    }, expectedMessage);
  };
});

moduleFor('ember-template-compiler: deprecate-send-action', DeprecateSendActionTest);

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/ember-template-compiler/tests/plugins/deprecate-send-action-test.js
discourse-ember-source-3.5.1.1 dist/es/ember-template-compiler/tests/plugins/deprecate-send-action-test.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-template-compiler/tests/plugins/deprecate-send-action-test.js