Icu 10082 ldap account creation form (#1783)
* chore: 🤖 Add support for LDAP account creation
This commit is contained in:
1 parent
0a80ae3c9d
commit
f5087ab4ee
3 files changed
+106
No files matched your search
@@ -85,6 +85,17 @@ module('Acceptance | accounts | create', function (hooks) {
|
||||
assert.strictEqual(this.server.db.accounts.length, accountsCount + 1);
|
||||
});
|
||||
|
||||
test('can create a new LDAP account', async function (assert) {
|
||||
assert.expect(1);
|
||||
const accountsCount = this.server.db.accounts.length;
|
||||
await visit(urls.newAccount);
|
||||
await fillIn('[name="name"]', 'Account name');
|
||||
await fillIn('[name="description"]', 'description');
|
||||
await fillIn('[name="login_name"]', 'username');
|
||||
await click('form [type="submit"]:not(:disabled)');
|
||||
assert.strictEqual(this.server.schema.accounts.all().models.length, accountsCount + 1);
|
||||
});
|
||||
|
||||
test('Users cannot create a new account without proper authorization', async function (assert) {
|
||||
assert.expect(2);
|
||||
instances.authMethod.authorized_collection_actions.accounts = [];
|
||||
@@ -130,6 +141,16 @@ module('Acceptance | accounts | create', function (hooks) {
|
||||
assert.strictEqual(currentURL(), urls.accounts);
|
||||
});
|
||||
|
||||
test('can cancel a new LDAP account creation', async function (assert) {
|
||||
assert.expect(2);
|
||||
const accountsCount = this.server.db.accounts.length;
|
||||
await visit(urls.newAccount);
|
||||
await fillIn('[name="name"]', 'Account name');
|
||||
await click('form button:not([type="submit"])');
|
||||
assert.strictEqual(this.server.db.accounts.length, accountsCount);
|
||||
assert.strictEqual(currentURL(), urls.accounts);
|
||||
});
|
||||
|
||||
test('saving a new account with invalid fields displays error messages', async function (assert) {
|
||||
assert.expect(2);
|
||||
this.server.post('/accounts', () => {
|
||||
|
||||
Reference in new issue
Block a user