Skip to content

Commit

Permalink
passing
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Mar 26, 2024
1 parent 5a079c4 commit 0b5c2f7
Show file tree
Hide file tree
Showing 24 changed files with 528 additions and 126 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Controller from '@ember/controller';
import { getDebugFunction, setDebugFunction } from '@ember/debug';

import { Component } from '../../utils/helpers';
import { DEPRECATIONS } from '../../../../deprecations';

const originalDebug = getDebugFunction('debug');
const noop = function () {};
Expand All @@ -15,7 +16,10 @@ moduleFor(
setDebugFunction('debug', noop);
super(...arguments);

expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);
expectDeprecation(
/Usage of the `\{\{action\}\}` modifier is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);
}

teardown() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { moduleFor, RenderingTestCase, applyMixins, strip, runTask } from 'inter
import { isEmpty } from '@ember/utils';
import { A as emberA } from '@ember/array';

import { DEPRECATIONS } from '../../../../deprecations';
import { Component } from '../../utils/helpers';

moduleFor(
Expand Down Expand Up @@ -757,7 +758,10 @@ moduleFor(
}

['@test renders with dot path and updates attributes'](assert) {
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
expectDeprecation(
/Usage of the `\(action\)` helper is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);

this.registerComponent('my-nested-component', {
ComponentClass: Component.extend({
Expand Down Expand Up @@ -841,8 +845,14 @@ moduleFor(
['@test parameters in a contextual component are mutable when value is a param'](assert) {
// This checks that a `(mut)` is added to parameters and attributes to
// contextual components when it is a param.
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);
expectDeprecation(
/Usage of the `\(action\)` helper is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);
expectDeprecation(
/Usage of the `\{\{action\}\}` modifier is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);

this.registerComponent('change-button', {
ComponentClass: Component.extend().reopenClass({
Expand Down Expand Up @@ -893,7 +903,10 @@ moduleFor(
}

['@test GH#13494 tagless blockless component with property binding'](assert) {
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
expectDeprecation(
/Usage of the `\(action\)` helper is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);
this.registerComponent('outer-component', {
ComponentClass: Component.extend({
message: 'hello',
Expand Down Expand Up @@ -1447,8 +1460,14 @@ class MutableParamTestGenerator {
generate({ title, setup }) {
return {
[`@test parameters in a contextual component are mutable when value is a ${title}`](assert) {
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);
expectDeprecation(
/Usage of the `\(action\)` helper is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);
expectDeprecation(
/Usage of the `\{\{action\}\}` modifier is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);
this.registerComponent('change-button', {
ComponentClass: Component.extend().reopenClass({
positionalParams: ['val'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { A as emberA } from '@ember/array';

import { Component, compile, htmlSafe } from '../../utils/helpers';
import { backtrackingMessageFor } from '../../utils/debug-stack';
import { DEPRECATIONS } from '../../../../deprecations';

moduleFor(
'Components test: curly components',
Expand Down Expand Up @@ -1428,7 +1429,10 @@ moduleFor(
) {
let componentInstance = null;

expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);
expectDeprecation(
/Usage of the `\{\{action\}\}` modifier is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);

this.registerComponent('non-block', {
ComponentClass: Component.extend({
Expand Down Expand Up @@ -3151,7 +3155,10 @@ moduleFor(
['@test returning `true` from an action does not bubble if `target` is not specified (GH#14275)'](
assert
) {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);
expectDeprecation(
/Usage of the `\{\{action\}\}` modifier is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);

this.registerComponent('display-toggle', {
ComponentClass: Component.extend({
Expand Down Expand Up @@ -3180,7 +3187,10 @@ moduleFor(
['@test returning `true` from an action bubbles to the `target` if specified'](assert) {
assert.expect(5);

expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);
expectDeprecation(
/Usage of the `\{\{action\}\}` modifier is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);

this.registerComponent('display-toggle', {
ComponentClass: Component.extend({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { set, computed } from '@ember/object';

import { Component } from '../../utils/helpers';
import { backtrackingMessageFor } from '../../utils/debug-stack';
import { DEPRECATIONS } from '../../../../deprecations';

moduleFor(
'Components test: dynamic components',
Expand Down Expand Up @@ -449,7 +450,10 @@ moduleFor(
}),
});

expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
expectDeprecation(
/Usage of the `\(action\)` helper is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);

let actionTriggered = 0;
this.registerComponent('outer-component', {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { moduleFor, RenderingTestCase, runDestroy, runTask } from 'internal-test-helpers';
import { set } from '@ember/object';
import { DEPRECATIONS } from '../../../../deprecations';

class InputRenderingTest extends RenderingTestCase {
$input() {
Expand Down Expand Up @@ -284,7 +285,10 @@ moduleFor(
assert
) {
assert.expect(3);
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
expectDeprecation(
/Usage of the `\(action\)` helper is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);

this.render(`<Input @enter={{action 'foo'}} />`, {
actions: {
Expand All @@ -302,7 +306,10 @@ moduleFor(

['@test sends `insert-newline` when <enter> is pressed'](assert) {
assert.expect(3);
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
expectDeprecation(
/Usage of the `\(action\)` helper is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);

this.render(`<Input @insert-newline={{action 'foo'}} />`, {
actions: {
Expand All @@ -322,7 +329,10 @@ moduleFor(
assert
) {
assert.expect(3);
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
expectDeprecation(
/Usage of the `\(action\)` helper is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);

this.render(`<Input @escape-press={{action 'foo'}} />`, {
actions: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { RenderingTestCase, moduleFor, runDestroy, runTask } from 'internal-test-helpers';

import { set } from '@ember/object';
import { DEPRECATIONS } from '../../../../deprecations';

class InputRenderingTest extends RenderingTestCase {
$input() {
Expand Down Expand Up @@ -153,7 +154,10 @@ moduleFor(
assert
) {
assert.expect(3);
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
expectDeprecation(
/Usage of the `\(action\)` helper is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);

this.render(`{{input enter=(action 'foo')}}`, {
actions: {
Expand All @@ -171,7 +175,10 @@ moduleFor(

['@test sends `insert-newline` when <enter> is pressed'](assert) {
assert.expect(3);
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
expectDeprecation(
/Usage of the `\(action\)` helper is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);

this.render(`{{input insert-newline=(action 'foo')}}`, {
actions: {
Expand All @@ -191,7 +198,10 @@ moduleFor(
assert
) {
assert.expect(3);
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
expectDeprecation(
/Usage of the `\(action\)` helper is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);

this.render(`{{input escape-press=(action 'foo')}}`, {
actions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { service } from '@ember/service';
import Engine from '@ember/engine';
import { DEBUG } from '@glimmer/env';
import { compile } from '../../../utils/helpers';
import { DEPRECATIONS } from '../../../../../deprecations';

// IE includes the host name
function normalizeUrl(url) {
Expand Down Expand Up @@ -1027,7 +1028,10 @@ moduleFor(
}

async ['@test it defaults to bubbling'](assert) {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);
expectDeprecation(
/Usage of the `\{\{action\}\}` modifier is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);
this.addTemplate(
'about',
`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { service } from '@ember/service';
import Engine from '@ember/engine';
import { DEBUG } from '@glimmer/env';
import { compile } from '../../../utils/helpers';
import { DEPRECATIONS } from '../../../../../deprecations';

// IE includes the host name
function normalizeUrl(url) {
Expand Down Expand Up @@ -1097,7 +1098,10 @@ moduleFor(
}

async ['@test it defaults to bubbling'](assert) {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);
expectDeprecation(
/Usage of the `\{\{action\}\}` modifier is deprecated./,
DEPRECATIONS.DEPRECATE_TEMPLATE_ACTION.isEnabled
);

this.addTemplate(
'about',
Expand Down
Loading

0 comments on commit 0b5c2f7

Please sign in to comment.