Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #83 from steveszc/bugfix/splatributes
Browse files Browse the repository at this point in the history
[bugfix] Add splattributes to form element
  • Loading branch information
steveszc authored Jan 16, 2021
2 parents 213f3c6 + 17c478d commit 186315c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions addon/components/fit-form.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<form
...attributes
{{on "submit" this.handleSubmit}}
{{on "keydown" this.handleKeydown}}
{{on "keyup" this.handleKeyup}}
Expand Down
19 changes: 19 additions & 0 deletions tests/integration/components/fit-form/component-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,25 @@ module('Integration | Component | fit-form', function (hooks) {
assert.dom('form').hasText('template block text');
});

test('Adding attributes to the form', async function (assert) {
await render(hbs`
<FitForm class="test_class" data-test="test selector">
template block text
</FitForm>
`);

assert
.dom('form')
.hasClass('test_class', 'form is rendered with the class');
assert
.dom('form')
.hasAttribute(
'data-test',
'test selector',
'form is rendered with the test selector'
);
});

test('a form with models', async function (assert) {
assert.expect(4);

Expand Down

0 comments on commit 186315c

Please sign in to comment.