Revert "FEATURE: default value to fields in automation"
This reverts commit 4d32635c69
.
This commit is contained in:
parent
6239f6994f
commit
196354e059
|
@ -2,14 +2,6 @@ import Component from "@glimmer/component";
|
|||
import { action } from "@ember/object";
|
||||
|
||||
export default class BaseField extends Component {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
|
||||
if (this.args.field.extra?.default_value) {
|
||||
this.args.field.metadata.value = this.args.field.extra.default_value;
|
||||
}
|
||||
}
|
||||
|
||||
get displayPlaceholders() {
|
||||
return (
|
||||
this.args.placeholders?.length && this.args.field?.acceptsPlaceholders
|
||||
|
|
|
@ -28,27 +28,4 @@ module("Integration | Component | da-choices-field", function (hooks) {
|
|||
|
||||
assert.strictEqual(this.field.metadata.value, 1);
|
||||
});
|
||||
|
||||
test("can have a default value", async function (assert) {
|
||||
this.field = new AutomationFabricators(getOwner(this)).field({
|
||||
component: "choices",
|
||||
extra: {
|
||||
content: [
|
||||
{ name: "Zero", id: 0 },
|
||||
{ name: "One", id: 1 },
|
||||
],
|
||||
default_value: 0,
|
||||
},
|
||||
});
|
||||
await render(
|
||||
hbs` <AutomationField @automation={{this.automation}} @field={{this.field}} />`
|
||||
);
|
||||
|
||||
assert.strictEqual(this.field.metadata.value, 0);
|
||||
|
||||
await selectKit().expand();
|
||||
await selectKit().selectRowByValue(1);
|
||||
|
||||
assert.strictEqual(this.field.metadata.value, 1);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue