mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
REFACTOR: Attach resize controls to images from the markdown pipeline (#8314)
This commit is contained in:
@ -755,34 +755,46 @@ QUnit.test("Image resizing buttons", async assert => {
|
||||
|
||||
// Default
|
||||
uploads[0] = "";
|
||||
await click(find(".button-wrapper .scale-btn[data-scale='50']")[0]);
|
||||
await click(
|
||||
find(".button-wrapper[data-image-index='0'] .scale-btn[data-scale='50']")
|
||||
);
|
||||
assertImageResized(assert, uploads);
|
||||
|
||||
// Targets the correct image if two on the same line
|
||||
uploads[6] =
|
||||
" ";
|
||||
await click(find(".button-wrapper .scale-btn[data-scale='50']")[3]);
|
||||
await click(
|
||||
find(".button-wrapper[data-image-index='3'] .scale-btn[data-scale='50']")
|
||||
);
|
||||
assertImageResized(assert, uploads);
|
||||
|
||||
// Try the other image on the same line
|
||||
uploads[6] =
|
||||
" ";
|
||||
await click(find(".button-wrapper .scale-btn[data-scale='75']")[4]);
|
||||
await click(
|
||||
find(".button-wrapper[data-image-index='4'] .scale-btn[data-scale='75']")
|
||||
);
|
||||
assertImageResized(assert, uploads);
|
||||
|
||||
// Make sure we target the correct image if there are duplicates
|
||||
uploads[7] = "";
|
||||
await click(find(".button-wrapper .scale-btn[data-scale='50']")[5]);
|
||||
await click(
|
||||
find(".button-wrapper[data-image-index='5'] .scale-btn[data-scale='50']")
|
||||
);
|
||||
assertImageResized(assert, uploads);
|
||||
|
||||
// Try the other dupe
|
||||
uploads[8] = "";
|
||||
await click(find(".button-wrapper .scale-btn[data-scale='75']")[6]);
|
||||
await click(
|
||||
find(".button-wrapper[data-image-index='6'] .scale-btn[data-scale='75']")
|
||||
);
|
||||
assertImageResized(assert, uploads);
|
||||
|
||||
// Don't mess with image titles
|
||||
uploads[10] = ``;
|
||||
await click(find(".button-wrapper .scale-btn[data-scale='75']")[8]);
|
||||
await click(
|
||||
find(".button-wrapper[data-image-index='8'] .scale-btn[data-scale='75']")
|
||||
);
|
||||
assertImageResized(assert, uploads);
|
||||
|
||||
await fillIn(
|
||||
|
Reference in New Issue
Block a user