Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TESTS es-classes] Adds a failing test for didReceiveAttrs #16144

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3119,6 +3119,24 @@ moduleFor('Components test: curly components', class extends RenderingTest {

this.assertText('3');
}

['@test has attrs by didReceiveAttrs with native classes'](assert) {
class FooBarComponent extends Component {
constructor() {
super();
// analagous to class field defaults
this.foo = 'bar';
}

didReceiveAttrs() {
assert.equal(this.foo, 'bar', 'received default attrs correctly');
}
}

this.registerComponent('foo-bar', { ComponentClass: FooBarComponent });

this.render('{{foo-bar}}');
}
});

if (jQueryDisabled) {
Expand Down Expand Up @@ -3199,4 +3217,4 @@ if (jQueryDisabled) {
}

});
}
}