Icu 12590 add filtering pagination support for roles (#2204)

* feat: 🎸 add search & pagination for roles

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12590
This commit is contained in:
Lisbet Alvarez authored and Zhihe Li committed 2024-04-12 14:55:33 -04:00
1 parent a78522e09a
commit 8be4e93a3c
14 files changed
+328 -117

No files matched your search

@@ -0,0 +1,22 @@
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import { waitUntil } from '@ember/test-helpers';
module('Unit | Controller | scopes/scope/roles/index', function (hooks) {
setupTest(hooks);
test('it exists', function (assert) {
let controller = this.owner.lookup('controller:scopes/scope/roles/index');
assert.ok(controller);
});
test('handleSearchInput action sets expected values correctly', async function (assert) {
let controller = this.owner.lookup('controller:scopes/scope/roles/index');
const searchValue = 'test';
controller.handleSearchInput({ target: { value: searchValue } });
await waitUntil(() => controller.search === searchValue);
assert.strictEqual(controller.page, 1);
assert.strictEqual(controller.search, searchValue);
});
});