Skip to content

Commit 305f2d4

Browse files
committed
refactor: deprecate-array-prototype-extensions - firstObject()
1 parent 520a90f commit 305f2d4

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

admin/tests/integration/components/certification-centers/information-view-test.gjs

+8-10
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,20 @@ import InformationView from 'pix-admin/components/certification-centers/informat
55
import { module, test } from 'qunit';
66

77
import setupIntlRenderingTest from '../../../helpers/setup-intl-rendering';
8-
function _createEmberDataHabilitations(store) {
9-
return ArrayProxy.create({
10-
content: [
11-
store.createRecord('complementary-certification', { id: 0, key: 'DROIT', label: 'Pix+Droit' }),
12-
store.createRecord('complementary-certification', { id: 1, key: 'CLEA', label: 'Cléa' }),
13-
],
14-
});
15-
}
168

179
module('Integration | Component | certification-centers/information-view', function (hooks) {
1810
setupIntlRenderingTest(hooks);
1911

2012
test('it should display label and values in read mode', async function (assert) {
2113
// given
2214
const store = this.owner.lookup('service:store');
23-
const availableHabilitations = _createEmberDataHabilitations(store);
15+
const pixDroitHabilitation = store.createRecord('complementary-certification', {
16+
id: 0,
17+
key: 'DROIT',
18+
label: 'Pix+Droit',
19+
});
20+
const cleaHabilitation = store.createRecord('complementary-certification', { id: 1, key: 'CLEA', label: 'Cléa' });
21+
const availableHabilitations = ArrayProxy.create({ content: [pixDroitHabilitation, cleaHabilitation] });
2422

2523
const certificationCenter = store.createRecord('certification-center', {
2624
name: 'Centre SCO',
@@ -29,7 +27,7 @@ module('Integration | Component | certification-centers/information-view', funct
2927
dataProtectionOfficerFirstName: 'Lucky',
3028
dataProtectionOfficerLastName: 'Number',
3129
dataProtectionOfficerEmail: 'lucky@example.net',
32-
habilitations: [availableHabilitations.firstObject],
30+
habilitations: [pixDroitHabilitation],
3331
});
3432

3533
// when

0 commit comments

Comments
 (0)