-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Glimmer2] Port {{textarea}} test to ember-glimmer.
- Loading branch information
1 parent
06e31d5
commit 592b614
Showing
2 changed files
with
49 additions
and
61 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
packages/ember-glimmer/tests/integration/helpers/text-area-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']() { | ||
this.render('{{textarea}}'); | ||
|
||
equal(this.$('textarea').length, 1); | ||
|
||
this.assertStableRerender(); | ||
} | ||
|
||
['@htmlbars Should become disabled when the context changes']() { | ||
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')); | ||
} | ||
|
||
}); |
This file was deleted.
Oops, something went wrong.