mirror of
https://github.com/discourse/discourse.git
synced 2025-01-04 11:53:48 +08:00
FIX: correclty allows to untoggle a fk toggle (#30404)
This commit is contained in:
parent
ebb6f1c2d2
commit
f392259e3f
|
@ -8,7 +8,7 @@ export default class FKControlToggle extends Component {
|
||||||
|
|
||||||
@action
|
@action
|
||||||
handleInput() {
|
handleInput() {
|
||||||
this.args.field.set(!this.args.value);
|
this.args.field.set(!this.args.field.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -31,6 +31,14 @@ module(
|
||||||
await formKit().submit();
|
await formKit().submit();
|
||||||
|
|
||||||
assert.deepEqual(data, { foo: true });
|
assert.deepEqual(data, { foo: true });
|
||||||
|
|
||||||
|
await formKit().field("foo").toggle();
|
||||||
|
|
||||||
|
assert.form().field("foo").hasValue(false);
|
||||||
|
|
||||||
|
await formKit().submit();
|
||||||
|
|
||||||
|
assert.deepEqual(data, { foo: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
test("when disabled", async function (assert) {
|
test("when disabled", async function (assert) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user