From a1c4d00eedc7fc20ca5f5cc62d910f568f775231 Mon Sep 17 00:00:00 2001 From: dharini Date: Mon, 16 Aug 2021 17:18:35 -0700 Subject: [PATCH] add test --- ui/admin/tests/acceptance/users/update-test.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/admin/tests/acceptance/users/update-test.js b/ui/admin/tests/acceptance/users/update-test.js index 3a5cba152..b37a5bec2 100644 --- a/ui/admin/tests/acceptance/users/update-test.js +++ b/ui/admin/tests/acceptance/users/update-test.js @@ -54,6 +54,14 @@ module('Acceptance | users', function (hooks) { assert.equal(this.server.db.users[0].name, 'Updated user name'); }); + test('cannot make changes to an existing user without proper authorization', async function (assert) { + assert.expect(1); + instances.user.authorized_actions = + instances.user.authorized_actions.filter((item) => item !== 'update'); + await visit(userURL); + assert.notOk(find('.rose-layout-page-actions .rose-button-secondary')); + }); + test('can cancel changes to an existing user', async function (assert) { assert.expect(1); await visit(userURL); @@ -63,14 +71,6 @@ module('Acceptance | users', function (hooks) { assert.notEqual(find('[name="name"]').value, 'Unsaved user name'); }); - test('cannot make changes to an existing user without proper authorization', async function (assert) { - assert.expect(1); - instances.user.authorized_actions = - instances.user.authorized_actions.filter((item) => item !== 'update'); - await visit(userURL); - assert.notOk(find('.rose-layout-page-actions .rose-button-secondary')); - }); - test('saving an existing user with invalid fields displays error messages', async function (assert) { assert.expect(2); this.server.patch('/users/:id', () => {