* chore: 🤖 Upgrade `addons/core` to Ember 4.12.2 Upgrade `addons/core` to Ember 4.12.2 ✅ Closes: ICU-11341 * refactor: 💡 testing updating plugin-proposal-decorators version Update `@babel/plugin-proposal-decorators` to latest version. * refactor: 💡 testing legacy plugin-proposa-decorators version Testin `legacy` version for `plugin-proposal-decorators` plugin * refactor: 💡 testing plugin-proposal-decorators Testing `@babel/plugin-proposal-decorators` * refactor: 💡 Revert @babel/exlint-parser to previous version Revert `@babel/eslint-parser` to use version 2018 EcmaScript version until further research is done on latest versions * Update package.json put @babel/core back into `devDependencies` * refactor: 💡 testing linging changes Pushed ember-tempalate-lint, prettier, and ember template lint plugin for prettier to latest versions to test why CI builds are not passing. ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-11341
56 lines
1.5 KiB
JavaScript
56 lines
1.5 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
*/
|
|
|
|
import { module, test } from 'qunit';
|
|
import { setupRenderingTest } from 'dummy/tests/helpers';
|
|
import { render } from '@ember/test-helpers';
|
|
import { hbs } from 'ember-cli-htmlbars';
|
|
import { setupIntl } from 'ember-intl/test-support';
|
|
|
|
module('Integration | Helper | reverse-indexed-display-name', function (hooks) {
|
|
setupRenderingTest(hooks);
|
|
setupIntl(hooks);
|
|
|
|
test('it renders the resource name with its position in parent array reversed', async function (assert) {
|
|
this.set('array', ['Boundary', 'is', 'cool!']);
|
|
|
|
await render(hbs`{{reverse-indexed-display-name
|
|
'resources.session-recording.connection.title_index'
|
|
this.array
|
|
'Boundary'
|
|
}}`);
|
|
|
|
assert.dom(this.element).hasText('Connection 3');
|
|
|
|
await render(hbs`{{reverse-indexed-display-name
|
|
'resources.session-recording.connection.title_index'
|
|
this.array
|
|
'is'
|
|
}}`);
|
|
|
|
assert.dom(this.element).hasText('Connection 2');
|
|
|
|
await render(hbs`{{reverse-indexed-display-name
|
|
'resources.session-recording.connection.title_index'
|
|
this.array
|
|
'cool!'
|
|
}}`);
|
|
|
|
assert.dom(this.element).hasText('Connection 1');
|
|
});
|
|
|
|
test('it does not render the position if the index cannot be found', async function (assert) {
|
|
this.set('array', ['Boundary', 'is', 'cool!']);
|
|
|
|
await render(hbs`{{reverse-indexed-display-name
|
|
'resources.session-recording.connection.title_index'
|
|
this.array
|
|
'Watchtower'
|
|
}}`);
|
|
|
|
assert.dom(this.element).hasText('Connection');
|
|
});
|
|
});
|