refactor: Conver password's setting form into set-password

This commit is contained in:
Susmitha Girumala committed 2020-09-15 11:16:27 -04:00
1 parent 62b4e71687
commit 64fb123b73
4 files changed
+27 -24

No files matched your search

@@ -1,6 +1,6 @@
<p>{{t 'descriptions.account-settings-overview'}}</p>
<Form::Account::Password::Settings
<Form::Account::Password::SetPassword
@model={{@model}}
@submit={{route-action "savePassword" @model}}
@cancel={{route-action "cancel" @model}}
@@ -0,0 +1,26 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | form/account/password/set-password', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
await render(hbs`<Form::Account::Password::SetPassword />`);
assert.equal(this.element.textContent.trim(), '');
// Template block usage:
await render(hbs`
<Form::Account::Password::SetPassword>
template block text
</Form::Account::Password::SetPassword>
`);
assert.equal(this.element.textContent.trim(), 'template block text');
});
});
@@ -1,23 +0,0 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, find } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | form/account/password/settings', function(hooks) {
setupRenderingTest(hooks);
test('it renders', async function(assert) {
this.submit = () => {};
this.cancel = () => {};
this.model = { type: 'password' };
await render(hbs`
<Form::Account::Password::Settings
@model={{this.model}}
@submit={{this.submit}}
@cancel={{this.cancel}}
/>`);
assert.ok(find('form'));
});
});