mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-31 18:48:08 +00:00
Ember Upgrade to 4.4 (#17086)
* runs ember-cli-update to 4.4.0 * updates yarn.lock * updates dependencies causing runtime errors (#17135) * Inject Store Service When Accessed Implicitly (#17345) * adds codemod for injecting store service * adds custom babylon parser with decorators-legacy plugin for jscodeshift transforms * updates inject-store-service codemod to only look for .extend object expressions and adds recast options * runs inject-store-service codemod on js files * replace query-params helper with hash (#17404) * Updates/removes dependencies throwing errors in Ember 4.4 (#17396) * updates ember-responsive to latest * updates ember-composable-helpers to latest and uses includes helper since contains was removed * updates ember-concurrency to latest * updates ember-cli-clipboard to latest * temporary workaround for toolbar-link component throwing errors for using params arg with LinkTo * adds missing store injection to auth configure route * fixes issue with string-list component throwing error for accessing prop in same computation * fixes non-iterable query params issue in mfa methods controller * refactors field-to-attrs to handle belongsTo rather than fragments * converts mount-config fragment to belongsTo on auth-method model * removes ember-api-actions and adds tune method to auth-method adapter * converts cluster replication attributes from fragment to relationship * updates ember-data, removes ember-data-fragments and updates yarn to latest * removes fragments from secret-engine model * removes fragment from test-form-model * removes commented out code * minor change to inject-store-service codemod and runs again on js files * Remove LinkTo positional params (#17421) * updates ember-cli-page-object to latest version * update toolbar-link to support link-to args and not positional params * adds replace arg to toolbar-link component * Clean up js lint errors (#17426) * replaces assert.equal to assert.strictEqual * update eslint no-console to error and disables invididual intended uses of console * cleans up hbs lint warnings (#17432) * Upgrade bug and test fixes (#17500) * updates inject-service codemod to take arg for service name and runs for flashMessages service * fixes hbs lint error after merging main * fixes flash messages * updates more deps * bug fixes * test fixes * updates ember-cli-content-security-policy and prevents default form submission throwing errors * more bug and test fixes * removes commented out code * fixes issue with code-mirror modifier sending change event on setup causing same computation error * Upgrade Clean Up (#17543) * updates deprecation workflow and filter * cleans up build errors, removes unused ivy-codemirror and sass and updates ember-cli-sass and node-sass to latest * fixes control groups test that was skipped after upgrade * updates control group service tests * addresses review feedback * updates control group service handleError method to use router.currentURL rather that transition.intent.url * adds changelog entry
This commit is contained in:
@@ -35,25 +35,24 @@ module('Integration | Component | form field', function (hooks) {
|
||||
this.attr = { name: 'foo' };
|
||||
this.model = model;
|
||||
await render(hbs`<FormField @attr={{this.attr}} @model={{this.model}} />`);
|
||||
|
||||
assert.equal(component.fields.objectAt(0).labelText, 'Foo', 'renders a label');
|
||||
assert.strictEqual(component.fields.objectAt(0).labelText[0], 'Foo', 'renders a label');
|
||||
assert.notOk(component.hasInput, 'renders only the label');
|
||||
});
|
||||
|
||||
test('it renders: string', async function (assert) {
|
||||
let [model, spy] = await setup.call(this, createAttr('foo', 'string', { defaultValue: 'default' }));
|
||||
assert.equal(component.fields.objectAt(0).labelText, 'Foo', 'renders a label');
|
||||
assert.equal(component.fields.objectAt(0).inputValue, 'default', 'renders default value');
|
||||
assert.strictEqual(component.fields.objectAt(0).labelText[0], 'Foo', 'renders a label');
|
||||
assert.strictEqual(component.fields.objectAt(0).inputValue, 'default', 'renders default value');
|
||||
assert.ok(component.hasInput, 'renders input for string');
|
||||
await component.fields.objectAt(0).input('bar').change();
|
||||
|
||||
assert.equal(model.get('foo'), 'bar');
|
||||
assert.strictEqual(model.get('foo'), 'bar');
|
||||
assert.ok(spy.calledWith('foo', 'bar'), 'onChange called with correct args');
|
||||
});
|
||||
|
||||
test('it renders: boolean', async function (assert) {
|
||||
let [model, spy] = await setup.call(this, createAttr('foo', 'boolean', { defaultValue: false }));
|
||||
assert.equal(component.fields.objectAt(0).labelText, 'Foo', 'renders a label');
|
||||
assert.strictEqual(component.fields.objectAt(0).labelText[0], 'Foo', 'renders a label');
|
||||
assert.notOk(component.fields.objectAt(0).inputChecked, 'renders default value');
|
||||
assert.ok(component.hasCheckbox, 'renders a checkbox for boolean');
|
||||
await component.fields.objectAt(0).clickLabel();
|
||||
@@ -64,24 +63,24 @@ module('Integration | Component | form field', function (hooks) {
|
||||
|
||||
test('it renders: number', async function (assert) {
|
||||
let [model, spy] = await setup.call(this, createAttr('foo', 'number', { defaultValue: 5 }));
|
||||
assert.equal(component.fields.objectAt(0).labelText, 'Foo', 'renders a label');
|
||||
assert.equal(component.fields.objectAt(0).inputValue, 5, 'renders default value');
|
||||
assert.strictEqual(component.fields.objectAt(0).labelText[0], 'Foo', 'renders a label');
|
||||
assert.strictEqual(component.fields.objectAt(0).inputValue, '5', 'renders default value');
|
||||
assert.ok(component.hasInput, 'renders input for number');
|
||||
await component.fields.objectAt(0).input(8).change();
|
||||
|
||||
assert.equal(model.get('foo'), 8);
|
||||
assert.strictEqual(model.get('foo'), '8');
|
||||
assert.ok(spy.calledWith('foo', '8'), 'onChange called with correct args');
|
||||
});
|
||||
|
||||
test('it renders: object', async function (assert) {
|
||||
await setup.call(this, createAttr('foo', 'object'));
|
||||
assert.equal(component.fields.objectAt(0).labelText, 'Foo', 'renders a label');
|
||||
assert.strictEqual(component.fields.objectAt(0).labelText[0], 'Foo', 'renders a label');
|
||||
assert.ok(component.hasJSONEditor, 'renders the json editor');
|
||||
});
|
||||
|
||||
test('it renders: string as json with clear button', async function (assert) {
|
||||
await setup.call(this, createAttr('foo', 'string', { editType: 'json', allowReset: true }));
|
||||
assert.equal(component.fields.objectAt(0).labelText, 'Foo', 'renders a label');
|
||||
assert.strictEqual(component.fields.objectAt(0).labelText[0], 'Foo', 'renders a label');
|
||||
assert.ok(component.hasJSONEditor, 'renders the json editor');
|
||||
assert.ok(component.hasJSONClearButton, 'renders button that will clear the JSON value');
|
||||
});
|
||||
@@ -91,12 +90,12 @@ module('Integration | Component | form field', function (hooks) {
|
||||
this,
|
||||
createAttr('foo', 'string', { defaultValue: 'goodbye', editType: 'textarea' })
|
||||
);
|
||||
assert.equal(component.fields.objectAt(0).labelText, 'Foo', 'renders a label');
|
||||
assert.strictEqual(component.fields.objectAt(0).labelText[0], 'Foo', 'renders a label');
|
||||
assert.ok(component.hasTextarea, 'renders a textarea');
|
||||
assert.equal(component.fields.objectAt(0).textareaValue, 'goodbye', 'renders default value');
|
||||
assert.strictEqual(component.fields.objectAt(0).textareaValue, 'goodbye', 'renders default value');
|
||||
await component.fields.objectAt(0).textarea('hello');
|
||||
|
||||
assert.equal(model.get('foo'), 'hello');
|
||||
assert.strictEqual(model.get('foo'), 'hello');
|
||||
assert.ok(spy.calledWith('foo', 'hello'), 'onChange called with correct args');
|
||||
});
|
||||
|
||||
@@ -117,7 +116,7 @@ module('Integration | Component | form field', function (hooks) {
|
||||
await component.fields.objectAt(0).select('h').change();
|
||||
await component.fields.objectAt(0).ttlTime('3');
|
||||
const expectedSeconds = `${3 * 3600}s`;
|
||||
assert.equal(model.get('foo'), expectedSeconds);
|
||||
assert.strictEqual(model.get('foo'), expectedSeconds);
|
||||
assert.ok(spy.calledWith('foo', expectedSeconds), 'onChange called with correct args');
|
||||
});
|
||||
|
||||
@@ -126,7 +125,7 @@ module('Integration | Component | form field', function (hooks) {
|
||||
await component.fields.objectAt(0).select('h').change();
|
||||
await component.fields.objectAt(0).ttlTime('3');
|
||||
const expectedSeconds = `${3 * 3600}s`;
|
||||
assert.equal(model.get('foo'), expectedSeconds);
|
||||
assert.strictEqual(model.get('foo'), expectedSeconds);
|
||||
assert.ok(spy.calledWith('foo', expectedSeconds), 'onChange called with correct args');
|
||||
});
|
||||
|
||||
@@ -138,7 +137,7 @@ module('Integration | Component | form field', function (hooks) {
|
||||
assert.ok(component.hasRadio, 'renders radio buttons');
|
||||
const selectedValue = 'SHA256';
|
||||
await component.selectRadioInput(selectedValue);
|
||||
assert.equal(model.get('foo'), selectedValue);
|
||||
assert.strictEqual(model.get('foo'), selectedValue);
|
||||
assert.ok(spy.calledWith('foo', selectedValue), 'onChange called with correct args');
|
||||
});
|
||||
|
||||
@@ -155,13 +154,17 @@ module('Integration | Component | form field', function (hooks) {
|
||||
let [model, spy] = await setup.call(this, createAttr('password', 'string', { sensitive: true }));
|
||||
assert.ok(component.hasMaskedInput, 'renders the masked-input component');
|
||||
await component.fields.objectAt(0).textarea('secret');
|
||||
assert.equal(model.get('password'), 'secret');
|
||||
assert.strictEqual(model.get('password'), 'secret');
|
||||
assert.ok(spy.calledWith('password', 'secret'), 'onChange called with correct args');
|
||||
});
|
||||
|
||||
test('it uses a passed label', async function (assert) {
|
||||
await setup.call(this, createAttr('foo', 'string', { label: 'Not Foo' }));
|
||||
assert.equal(component.fields.objectAt(0).labelText, 'Not Foo', 'renders the label from options');
|
||||
assert.strictEqual(
|
||||
component.fields.objectAt(0).labelText[0],
|
||||
'Not Foo',
|
||||
'renders the label from options'
|
||||
);
|
||||
});
|
||||
|
||||
test('it renders a help tooltip', async function (assert) {
|
||||
|
||||
Reference in New Issue
Block a user