mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 15:14:16 +08:00
FIX: introduces onSelectAny (regroup onSelect and onSelectNone) (#7594)
This commit is contained in:
@ -924,3 +924,37 @@ componentTest("noopRow", {
|
||||
assert.equal(this.get("value"), "green");
|
||||
}
|
||||
});
|
||||
|
||||
componentTest("onSelectAny", {
|
||||
template: `<div class='test-external-action'></div>{{single-select none="none" content=content onSelectAny=(action externalAction)}}`,
|
||||
|
||||
beforeEach() {
|
||||
this.set("externalAction", actual => {
|
||||
find(".test-external-action").text(actual.value);
|
||||
});
|
||||
|
||||
this.set("content", ["blue"]);
|
||||
},
|
||||
|
||||
async test(assert) {
|
||||
await this.get("subject").expand();
|
||||
await this.get("subject").selectRowByValue("blue");
|
||||
|
||||
assert.equal(
|
||||
find(".test-external-action")
|
||||
.text()
|
||||
.trim(),
|
||||
"blue"
|
||||
);
|
||||
|
||||
await this.get("subject").expand();
|
||||
await this.get("subject").selectNoneRow();
|
||||
|
||||
assert.equal(
|
||||
find(".test-external-action")
|
||||
.text()
|
||||
.trim(),
|
||||
"__none__"
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user