/** * Copyright (c) HashiCorp, Inc. * SPDX-License-Identifier: MPL-2.0 */ import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; import { waitUntil } from '@ember/test-helpers'; 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); }); 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); }); });