Skip to content

Commit 0e7d487

Browse files
committed
test: 💍 Add acceptance test for related search with alias
1 parent 57ca8e4 commit 0e7d487

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

ui/admin/tests/acceptance/aliases/list-test.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,46 @@ module('Acceptance | aliases | list', function (hooks) {
279279
.includesText(intl.t('titles.no-results-found'));
280280
});
281281

282+
test('user can search for aliases by associated target name', async function (assert) {
283+
setRunOptions({
284+
rules: {
285+
'color-contrast': {
286+
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-08-01
287+
enabled: false,
288+
},
289+
},
290+
});
291+
292+
// Create a target with a specific name
293+
const targetWithName = this.server.create('target', {
294+
name: 'A real production target',
295+
scope: instances.scopes.project,
296+
});
297+
298+
// Create an alias associated with this target
299+
const aliasWithNamedTarget = this.server.create('alias', {
300+
scope: instances.scopes.global,
301+
destination_id: targetWithName.id,
302+
});
303+
304+
const urlAliasWithNamedTarget = `${urls.aliases}/${aliasWithNamedTarget.id}`;
305+
306+
await visit(urls.globalScope);
307+
308+
await click(commonSelectors.HREF(urls.aliases));
309+
310+
assert.dom(commonSelectors.HREF(urls.alias)).exists();
311+
assert.dom(commonSelectors.HREF(urls.aliasWithTarget)).exists();
312+
assert.dom(commonSelectors.HREF(urlAliasWithNamedTarget)).exists();
313+
314+
await fillIn(commonSelectors.SEARCH_INPUT, 'production target');
315+
await waitFor(commonSelectors.HREF(urls.alias), { count: 0 });
316+
317+
assert.dom(commonSelectors.HREF(urlAliasWithNamedTarget)).exists();
318+
assert.dom(commonSelectors.HREF(urls.alias)).doesNotExist();
319+
assert.dom(commonSelectors.HREF(urls.aliasWithTarget)).doesNotExist();
320+
});
321+
282322
test('aliases are sorted by created_time descending by default', async function (assert) {
283323
setRunOptions({
284324
rules: {

0 commit comments

Comments
 (0)