Skip to content

Commit

Permalink
Add more expectDeprecation to mark places that will need updating whe…
Browse files Browse the repository at this point in the history
…n we remove action
  • Loading branch information
NullVoxPopuli committed Mar 9, 2024
1 parent 0c86db1 commit cb5644b
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,8 @@ moduleFor(
}

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

this.registerComponent('my-nested-component', {
ComponentClass: Component.extend({
didReceiveAttrs() {
Expand Down Expand Up @@ -839,6 +841,8 @@ 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./);

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

['@test GH#13494 tagless blockless component with property binding'](assert) {
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
this.registerComponent('outer-component', {
ComponentClass: Component.extend({
message: 'hello',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ moduleFor(

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

this.render(`<Input @insert-newline={{action 'foo'}} />`, {
actions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,7 @@ moduleFor(
}

async ['@test it defaults to bubbling'](assert) {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);
this.addTemplate(
'about',
`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,8 @@ moduleFor(
}

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

this.addTemplate(
'about',
`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ moduleFor(
}

'@test tracked properties that are uninitialized do not throw an error'() {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);

let CountComponent = Component.extend({
count: tracked(),

Expand All @@ -162,6 +164,8 @@ moduleFor(
}

'@test tracked properties rerender when updated'() {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);

let CountComponent = Component.extend({
count: tracked({ value: 0 }),

Expand All @@ -185,6 +189,8 @@ moduleFor(
}

'@test tracked properties rerender when updated outside of a runloop'(assert) {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);

let done = assert.async();

let CountComponent = Component.extend({
Expand Down Expand Up @@ -216,6 +222,8 @@ moduleFor(
}

'@test nested tracked properties rerender when updated'() {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);

let Counter = EmberObject.extend({
count: tracked({ value: 0 }),
});
Expand Down Expand Up @@ -243,6 +251,8 @@ moduleFor(
}

'@test array properties rerender when updated'() {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);

let NumListComponent = Component.extend({
numbers: tracked({ initializer: () => A([1, 2, 3]) }),

Expand Down Expand Up @@ -270,6 +280,8 @@ moduleFor(
}

'@test getters update when dependent properties are invalidated'() {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);

let CountComponent = Component.extend({
count: tracked({ value: 0 }),

Expand Down Expand Up @@ -299,6 +311,8 @@ moduleFor(
}

'@test getters update when dependent computeds are invalidated'() {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);

let CountComponent = Component.extend({
_count: 0,

Expand Down Expand Up @@ -340,6 +354,8 @@ moduleFor(
}

'@test nested getters update when dependent properties are invalidated'() {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);

let Counter = EmberObject.extend({
count: tracked({ value: 0 }),

Expand Down Expand Up @@ -373,6 +389,8 @@ moduleFor(
}

'@test tracked object passed down through components updates correctly'(assert) {
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);

let Person = EmberObject.extend({
first: tracked({ value: 'Rob' }),
last: tracked({ value: 'Jackson' }),
Expand Down Expand Up @@ -423,6 +441,8 @@ moduleFor(
}

'@test yielded getters update correctly'() {
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);

let PersonComponent = Component.extend({
first: tracked({ value: 'Rob' }),
last: tracked({ value: 'Jackson' }),
Expand Down Expand Up @@ -462,6 +482,8 @@ moduleFor(
}

'@test yielded nested getters update correctly'() {
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);

let Person = EmberObject.extend({
first: tracked({ value: 'Rob' }),
last: tracked({ value: 'Jackson' }),
Expand Down Expand Up @@ -587,6 +609,8 @@ moduleFor(
'@test downstream property changes do not invalidate upstream component getters/arguments'(
assert
) {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);

let outerRenderCount = 0;
let innerRenderCount = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ moduleFor(
},
});

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

this.add('controller:application', ToggleController);

this.addTemplate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ moduleFor(
}

['@test case insensitive events'](assert) {
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);

let receivedEvent;

this.registerComponent('x-bar', {
Expand All @@ -153,6 +155,7 @@ moduleFor(
}

['@test case sensitive events'](assert) {
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
let receivedEvent;

this.registerComponent('x-bar', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ moduleFor(
}

'@test can use `this` if bound prior to passing to fn'(assert) {
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
this.render(`{{stash stashedFn=(fn (action this.myFunc) this.arg1)}}`, {
myFunc(arg1) {
return `arg1: ${arg1}, arg2: ${this.arg2}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ moduleFor(
'Helper Tracked Properties',
class extends RenderingTestCase {
'@test tracked properties rerender when updated'(assert) {
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
let computeCount = 0;

let PersonComponent = Component.extend({
Expand Down Expand Up @@ -92,6 +93,7 @@ moduleFor(
}

'@test getters update when dependent properties are invalidated'(assert) {
expectDeprecation(/Usage of the `\(action\)` helper is deprecated./);
let computeCount = 0;

let PersonComponent = Component.extend({
Expand Down Expand Up @@ -144,6 +146,7 @@ moduleFor(
}

'@test array properties rerender when updated'() {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);
let NumListComponent = Component.extend({
numbers: tracked({ initializer: () => A([1, 2, 3]) }),

Expand Down Expand Up @@ -175,6 +178,7 @@ moduleFor(
}

'@test custom ember array properties rerender when updated'() {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);
let CustomArray = EmberObject.extend(MutableArray, {
init() {
this._super(...arguments);
Expand Down
1 change: 1 addition & 0 deletions packages/@ember/application/tests/visit_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ moduleFor(
}

[`@test Ember Islands-style setup`](assert) {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);
let xFooInitCalled = false;
let xFooDidInsertElementCalled = false;

Expand Down
1 change: 1 addition & 0 deletions packages/ember/tests/integration/multiple-app-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ moduleFor(
}

[`@test booting multiple applications can properly handle events`](assert) {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);
let actions = [];
this.addFactoriesToResolver(actions, this.resolver);
this.addFactoriesToResolver(actions, this.secondResolver);
Expand Down
1 change: 1 addition & 0 deletions packages/ember/tests/routing/query_params_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ moduleFor(
async ['@test queryParams are updated when a controller property is set and the route is refreshed. Issue #13263 '](
assert
) {
expectDeprecation(/Usage of the `\{\{action\}\}` modifier is deprecated./);
this.addTemplate(
'application',
'<button id="test-button" {{action \'increment\'}}>Increment</button><span id="test-value">{{this.foo}}</span>{{outlet}}'
Expand Down

0 comments on commit cb5644b

Please sign in to comment.