test: Remove duplicate save test
This commit is contained in:
1 file changed
+1
-41
@@ -98,10 +98,7 @@ module('Acceptance | accounts', function (hooks) {
|
||||
test('can create a new account', async function (assert) {
|
||||
assert.expect(1);
|
||||
const accountsCount = this.server.db.accounts.length;
|
||||
await visit(urls.accounts);
|
||||
// Find and click account creation dropdown link
|
||||
await click('.rose-layout-page-actions .rose-dropdown summary');
|
||||
await click('.rose-layout-page-actions .rose-dropdown .rose-dropdown-content .rose-dropdown-link');
|
||||
await visit(urls.newAccount);
|
||||
await fillIn('[name="name"]', 'Account name');
|
||||
await fillIn('[name="description"]', 'description');
|
||||
await fillIn('[name="login_name"]', 'username');
|
||||
@@ -212,43 +209,6 @@ module('Acceptance | accounts', function (hooks) {
|
||||
);
|
||||
});
|
||||
|
||||
test('saving a new account with invalid fields displays error messages', async function (assert) {
|
||||
assert.expect(2);
|
||||
this.server.post('/accounts', () => {
|
||||
return new Response(
|
||||
400,
|
||||
{},
|
||||
{
|
||||
status: 400,
|
||||
code: 'invalid_argument',
|
||||
message: 'The request was invalid.',
|
||||
details: {
|
||||
request_fields: [
|
||||
{
|
||||
name: 'name',
|
||||
description: 'Name is required.',
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
);
|
||||
});
|
||||
await visit(urls.newAccount);
|
||||
await fillIn('[name="name"]', 'save new account');
|
||||
await click('form [type="submit"]');
|
||||
await a11yAudit();
|
||||
assert.ok(
|
||||
find('[role="alert"]').textContent.trim(),
|
||||
'The request was invalid.',
|
||||
'Displays primary error message.'
|
||||
);
|
||||
assert.ok(
|
||||
find('.rose-form-error-message').textContent.trim(),
|
||||
'Name is required.',
|
||||
'Displays field-level errors.'
|
||||
);
|
||||
});
|
||||
|
||||
test('saving an existing account with invalid fields displays error messages', async function (assert) {
|
||||
assert.expect(2);
|
||||
this.server.patch('/accounts/:id', () => {
|
||||
|
||||
Reference in new issue
Block a user