2024-03-19 21:56:39 -05:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
2024-03-14 13:28:43 -07:00
|
|
|
import { module, test } from 'qunit';
|
2024-04-02 13:27:02 -05:00
|
|
|
import { setupTest } from 'ember-qunit';
|
|
|
|
|
import { waitUntil } from '@ember/test-helpers';
|
2024-03-14 13:28:43 -07:00
|
|
|
|
|
|
|
|
module('Unit | Controller | scopes/scope/groups/index', function (hooks) {
|
|
|
|
|
setupTest(hooks);
|
|
|
|
|
|
|
|
|
|
test('it exists', function (assert) {
|
|
|
|
|
let controller = this.owner.lookup('controller:scopes/scope/groups/index');
|
|
|
|
|
assert.ok(controller);
|
|
|
|
|
});
|
2024-04-02 13:27:02 -05:00
|
|
|
|
|
|
|
|
test('handleSearchInput action sets expected values correctly', async function (assert) {
|
|
|
|
|
let controller = this.owner.lookup('controller:scopes/scope/targets/index');
|
|
|
|
|
const searchValue = 'group';
|
|
|
|
|
controller.handleSearchInput({ target: { value: searchValue } });
|
|
|
|
|
await waitUntil(() => controller.search === searchValue);
|
|
|
|
|
|
|
|
|
|
assert.strictEqual(controller.page, 1);
|
|
|
|
|
assert.strictEqual(controller.search, searchValue);
|
|
|
|
|
});
|
2024-03-14 13:28:43 -07:00
|
|
|
});
|