-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds test coverage for save-on-enter.
adds test coverage for save-on-enter.
- Loading branch information
1 parent
7024f4c
commit d074f1c
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -109,4 +109,38 @@ module('Integration | Component | school/emails-editor', function (hooks) { | |
); | ||
await component.cancel(); | ||
}); | ||
|
||
test('save on enter in administrator email input', async function (assert) { | ||
assert.expect(2); | ||
const school = this.server.create('school'); | ||
const schoolModel = await this.owner.lookup('service:store').findRecord('school', school.id); | ||
this.set('school', schoolModel); | ||
this.set('save', (administratorEmail, changeAlertRecipients) => { | ||
assert.strictEqual(administratorEmail, '[email protected]'); | ||
assert.strictEqual(changeAlertRecipients, '[email protected], [email protected]'); | ||
}); | ||
await render( | ||
hbs`<School::EmailsEditor @school={{this.school}} @save={{this.save}} @cancel={{(noop)}} />`, | ||
); | ||
await component.administratorEmail.set('[email protected]'); | ||
await component.changeAlertRecipients.set('[email protected], [email protected]'); | ||
await component.administratorEmail.save(); | ||
}); | ||
|
||
test('save on enter in change-alerts recipients input', async function (assert) { | ||
assert.expect(2); | ||
const school = this.server.create('school'); | ||
const schoolModel = await this.owner.lookup('service:store').findRecord('school', school.id); | ||
this.set('school', schoolModel); | ||
this.set('save', (administratorEmail, changeAlertRecipients) => { | ||
assert.strictEqual(administratorEmail, '[email protected]'); | ||
assert.strictEqual(changeAlertRecipients, '[email protected], [email protected]'); | ||
}); | ||
await render( | ||
hbs`<School::EmailsEditor @school={{this.school}} @save={{this.save}} @cancel={{(noop)}} />`, | ||
); | ||
await component.administratorEmail.set('[email protected]'); | ||
await component.changeAlertRecipients.set('[email protected], [email protected]'); | ||
await component.changeAlertRecipients.save(); | ||
}); | ||
}); |
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