mirror of
https://github.com/discourse/discourse.git
synced 2025-06-23 04:31:47 +08:00
FIX: Don't load images that don't exist in test
This makes 404 requests and fills up the logs with junk
This commit is contained in:
@ -112,7 +112,7 @@ QUnit.test("Composer upload placeholder", async assert => {
|
||||
original_filename: "test.png",
|
||||
thumbnail_width: 200,
|
||||
thumbnail_height: 300,
|
||||
url: "/uploads/test1.ext"
|
||||
url: "/images/avatar.png?1"
|
||||
}
|
||||
};
|
||||
|
||||
@ -124,7 +124,7 @@ QUnit.test("Composer upload placeholder", async assert => {
|
||||
original_filename: "test.png",
|
||||
thumbnail_width: 100,
|
||||
thumbnail_height: 200,
|
||||
url: "/uploads/test2.ext"
|
||||
url: "/images/avatar.png?2"
|
||||
}
|
||||
};
|
||||
|
||||
@ -136,7 +136,7 @@ QUnit.test("Composer upload placeholder", async assert => {
|
||||
original_filename: "image.png",
|
||||
thumbnail_width: 300,
|
||||
thumbnail_height: 400,
|
||||
url: "/uploads/test3.ext"
|
||||
url: "/images/avatar.png?3"
|
||||
}
|
||||
};
|
||||
|
||||
@ -148,7 +148,7 @@ QUnit.test("Composer upload placeholder", async assert => {
|
||||
original_filename: "ima++ge.png",
|
||||
thumbnail_width: 300,
|
||||
thumbnail_height: 400,
|
||||
url: "/uploads/test3.ext"
|
||||
url: "/images/avatar.png?3"
|
||||
}
|
||||
};
|
||||
|
||||
@ -177,19 +177,19 @@ QUnit.test("Composer upload placeholder", async assert => {
|
||||
await find(".wmd-controls").trigger("fileuploaddone", data2);
|
||||
assert.equal(
|
||||
find(".d-editor-input").val(),
|
||||
"[Uploading: test.png...]()  [Uploading: ima++ge.png...]() [Uploading: image.png...]() "
|
||||
"[Uploading: test.png...]()  [Uploading: ima++ge.png...]() [Uploading: image.png...]() "
|
||||
);
|
||||
|
||||
await find(".wmd-controls").trigger("fileuploaddone", data3);
|
||||
assert.equal(
|
||||
find(".d-editor-input").val(),
|
||||
"[Uploading: test.png...]()  [Uploading: ima++ge.png...]()  "
|
||||
"[Uploading: test.png...]()  [Uploading: ima++ge.png...]()  "
|
||||
);
|
||||
|
||||
await find(".wmd-controls").trigger("fileuploaddone", data1);
|
||||
assert.equal(
|
||||
find(".d-editor-input").val(),
|
||||
"  [Uploading: ima++ge.png...]()  "
|
||||
"  [Uploading: ima++ge.png...]()  "
|
||||
);
|
||||
});
|
||||
|
||||
@ -760,7 +760,7 @@ QUnit.test("Image resizing buttons", async assert => {
|
||||
// 4 Wrapped in backquetes should not work
|
||||
"``",
|
||||
// 5 html image - should not work
|
||||
"<img src='http://someimage.jpg' wight='20' height='20'>",
|
||||
"<img src='/images/avatar.png' wight='20' height='20'>",
|
||||
// 6 two images one the same line, but both are syntactically correct - both should work
|
||||
" ",
|
||||
// 7 & 8 Identical images - both should work
|
||||
@ -771,7 +771,7 @@ QUnit.test("Image resizing buttons", async assert => {
|
||||
// 10 Image with markdown title - should work
|
||||
``,
|
||||
// 11 bbcode - should not work
|
||||
"[img]http://example.com/image.jpg[/img]",
|
||||
"[img]/images/avatar.png[/img]",
|
||||
// 12 Image with data attributes
|
||||
""
|
||||
];
|
||||
|
Reference in New Issue
Block a user