mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: checklist weren't working if there was an image URL
When clicking a "checklist", we're parsing the raw to change the state of the checklist that was clicked. If there was an image URL with an empty alternative text in the raw "" it would consider the "[]" as an empty checklist item. Internal - t/124499
This commit is contained in:
@@ -38,6 +38,19 @@ acceptance("discourse-checklist | checklist", function (needs) {
|
||||
]);
|
||||
});
|
||||
|
||||
test("does not check an image URL", async function (assert) {
|
||||
const [$elem, updated] = await prepare(`
|
||||

|
||||
[] first
|
||||
[] second
|
||||
`);
|
||||
|
||||
$elem.find(".chcklst-box")[0].click();
|
||||
|
||||
const output = await updated;
|
||||
assert.ok(output.includes("[x] first"));
|
||||
});
|
||||
|
||||
test("make checkboxes readonly while updating", async function (assert) {
|
||||
const [$elem, updated] = await prepare(`
|
||||
[ ] first
|
||||
|
||||
Reference in New Issue
Block a user