fix: 🐛 update id to ids for target onboarding creation (#2120)

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12412
This commit is contained in:
Cameron Perera authored and GitHub committed 2024-01-30 09:13:20 -06:00
1 parent 08d9801829
commit f366f0a858
3 files changed
+11 -11

No files matched your search

+1 -1
View File
@@ -135,7 +135,7 @@ export default class OnboardingRoute extends Route {
await role.save();
await role.saveGrantStrings([
`type=target;actions=list`,
`id=${target.id};actions=authorize-session`,
`ids=${target.id};actions=authorize-session`,
]);
} catch (error) {
// Redirect to targets that belong to scope
@@ -97,7 +97,7 @@ module('Acceptance | roles | grants', function (hooks) {
const attrs = JSON.parse(requestBody);
assert.strictEqual(
attrs.grant_strings[0],
'id=123,action=delete',
'ids=123,action=delete',
'A grant is updated',
);
const id = idMethod.split(':')[0];
@@ -105,17 +105,17 @@ module('Acceptance | roles | grants', function (hooks) {
},
);
await visit(urls.grants);
await fillIn(`${grantsForm} [name="grant"]`, 'id=123,action=delete');
await fillIn(`${grantsForm} [name="grant"]`, 'ids=123,action=delete');
await click('.rose-form-actions [type="submit"]:not(:disabled)');
});
test('cancel a grant update', async function (assert) {
await visit(urls.grants);
await fillIn(`${grantsForm} [name="grant"]`, 'id=123,action=delete');
await fillIn(`${grantsForm} [name="grant"]`, 'ids=123,action=delete');
await click('.rose-form-actions button:not([type="submit"])');
assert.notEqual(
find(`${grantsForm} [name="grant"]`).value,
'id=123,action=delete',
'ids=123,action=delete',
);
});
@@ -137,7 +137,7 @@ module('Acceptance | roles | grants', function (hooks) {
findAll(`${grantsForm} [name="grant"]`).length,
grantsCount,
);
await fillIn(`${grantsForm} [name="grant"]`, 'id=123,action=delete');
await fillIn(`${grantsForm} [name="grant"]`, 'ids=123,action=delete');
await click('.rose-form-actions [type="submit"]:not(:disabled)');
assert.ok(find('[role="alert"]'));
});
@@ -158,14 +158,14 @@ module('Acceptance | roles | grants', function (hooks) {
},
);
await visit(urls.grants);
await fillIn(`${newGrantForm} [name="grant"]`, 'id=123,action=delete');
await fillIn(`${newGrantForm} [name="grant"]`, 'ids=123,action=delete');
await click(`${newGrantForm} [type="submit"]:not(:disabled)`);
await click('.rose-form-actions [type="submit"]:not(:disabled)');
});
test('cancel a grant creation', async function (assert) {
await visit(urls.grants);
await fillIn(`${newGrantForm} [name="grant"]`, 'id=123,action=delete');
await fillIn(`${newGrantForm} [name="grant"]`, 'ids=123,action=delete');
await click(`${newGrantForm} [type="submit"]:not(:disabled)`);
await click('.rose-form-actions button:not([type="submit"])');
assert.notOk(find(`${newGrantForm} [name="grant"]`).value);
@@ -189,7 +189,7 @@ module('Acceptance | roles | grants', function (hooks) {
findAll(`${grantsForm} [name="grant"]`).length,
grantsCount,
);
await fillIn(`${newGrantForm} [name="grant"]`, 'id=123,action=delete');
await fillIn(`${newGrantForm} [name="grant"]`, 'ids=123,action=delete');
await click(`${newGrantForm} [type="submit"]:not(:disabled)`);
await click('.rose-form-actions [type="submit"]:not(:disabled)');
assert.ok(find('[role="alert"]'));