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

[Glimmer2] Port {{textarea}} test to ember-glimmer. #13215

Merged
merged 1 commit into from
Apr 10, 2016
Merged
Show file tree
Hide file tree
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
49 changes: 49 additions & 0 deletions packages/ember-glimmer/tests/integration/helpers/text-area-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { set } from 'ember-metal/property_set';
import TextArea from 'ember-views/views/text_area';
import { RenderingTest, moduleFor } from '../../utils/test-case';

class TextAreaRenderingTest extends RenderingTest {
constructor() {
super();

this.registerComponent('-text-area', { ComponentClass: TextArea });
}
}

moduleFor('Helpers test: {{textarea}}', class extends TextAreaRenderingTest {

['@htmlbars Should insert a textarea']() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaces #45

this.render('{{textarea}}');

equal(this.$('textarea').length, 1);

this.assertStableRerender();
}

['@htmlbars Should become disabled when the context changes']() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaces #49

this.render('{{textarea disabled=disabled}}');
ok(this.$('textarea').is(':not(:disabled)'));

this.assertStableRerender();

this.runTask(() => set(this.context, 'disabled', true));
ok(this.$('textarea').is(':disabled'));

this.runTask(() => set(this.context, 'disabled', false));
ok(this.$('textarea').is(':not(:disabled)'));
}

['@htmlbars Should bind its contents to the specified value']() {
this.render('{{textarea value=val}}', { val: 'A beautiful day in Seattle' });
ok(this.$('textarea').val('A beautiful day in Seattle'));

this.assertStableRerender();

this.runTask(() => set(this.context, 'val', 'Auckland'));
ok(this.$('textarea').val('Auckland'));

this.runTask(() => set(this.context, 'val', 'A beautiful day in Seattle'));
ok(this.$('textarea').val('A beautiful day in Seattle'));
}

});
61 changes: 0 additions & 61 deletions packages/ember-htmlbars/tests/helpers/text_area_test.js

This file was deleted.