A platform for community discussion. Free, open, simple.
DEV: Avoid triggering 404 errors in tests (#17404)
Jarek Radosz0d6929d93577
diff --git a/app/assets/javascripts/discourse/tests/acceptance/composer-uploads-uppy-test.js b/app/assets/javascripts/discourse/tests/acceptance/composer-uploads-uppy-test.jsindex 673896bf3a1..c4d00833f58 100644--- a/app/assets/javascripts/discourse/tests/acceptance/composer-uploads-uppy-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/composer-uploads-uppy-test.js@@ -18,7 +18,7 @@ function pretender(server, helper) {server.post("/uploads/lookup-urls", () => {return helper.response([{- url: "//testbucket.s3.dualstack.us-east-2.amazonaws.com/original/1X/f1095d89269ff22e1818cf54b73e857261851019.jpeg",+ url: "/images/discourse-logo-sketch-small.png",short_path: "/uploads/short-url/yoj8pf9DdIeHRRULyw7i57GAYdz.jpeg",short_url: "upload://yoj8pf9DdIeHRRULyw7i57GAYdz.jpeg",},@@ -40,7 +40,7 @@ function pretender(server, helper) {short_url: "upload://yoj8pf9DdIeHRRULyw7i57GAYdz.jpeg",thumbnail_height: 320,thumbnail_width: 690,- url: "//testbucket.s3.dualstack.us-east-2.amazonaws.com/original/1X/f1095d89269ff22e1818cf54b73e857261851019.jpeg",+ url: "/images/discourse-logo-sketch-small.png",width: 1920,});},@@ -441,14 +441,14 @@ acceptance("Uppy Composer Attachment - Upload Handler", function (needs) {test("should use upload handler if the matching extension is used and a single file is uploaded", async function (assert) {await visit("/");await click("#create-topic");- const image = createFile("handlertest.png");+ const image = createFile("handler-test.png");const appEvents = loggedInUser().appEvents;const done = assert.async();appEvents.on("composer:uploads-aborted", async () => {assert.strictEqual(query(".bootbox .modal-body").innerHTML,- "This is an upload handler test for handlertest.png. The file WAS a native file object.",+ "This is an upload handler test for handler-test.png. The file WAS a native file object.","it should show the bootbox triggered by the upload handler");await click(".modal-footer .btn");diff --git a/app/assets/javascripts/discourse/tests/acceptance/lightbox-test.js b/app/assets/javascripts/discourse/tests/acceptance/lightbox-test.jsindex 997279196fa..365d75680c3 100644--- a/app/assets/javascripts/discourse/tests/acceptance/lightbox-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/lightbox-test.js@@ -10,8 +10,8 @@ acceptance("Lightbox", function (needs) {needs.pretender((server, helper) => {const topicResponse = cloneJSON(topicFixtures["/t/280/1.json"]);topicResponse.post_stream.posts[0].cooked += `<div class="lightbox-wrapper">- <a class="lightbox" href="//discourse.local/uploads/default/original/1X/ad768537789cdf4679a18161ac0b0b6f0f4ccf9e.jpeg" data-download-href="//discourse.local/uploads/default/ad768537789cdf4679a18161ac0b0b6f0f4ccf9e" title="image">- <img src="//discourse.local/uploads/default/optimized/1X/ad768537789cdf4679a18161ac0b0b6f0f4ccf9e_2_690x387.jpeg" alt="image" data-base62-sha1="oKwwVE8qLWFBkE5UJeCs2EwxHHg" width="690" height="387" srcset="//discourse.local/uploads/default/optimized/1X/ad768537789cdf4679a18161ac0b0b6f0f4ccf9e_2_690x387.jpeg, //discourse.local/uploads/default/optimized/1X/ad768537789cdf4679a18161ac0b0b6f0f4ccf9e_2_1035x580.jpeg 1.5x, //discourse.local/uploads/default/optimized/1X/ad768537789cdf4679a18161ac0b0b6f0f4ccf9e_2_1380x774.jpeg 2x" data-small-upload="//discourse.local/uploads/default/optimized/1X/ad768537789cdf4679a18161ac0b0b6f0f4ccf9e_2_10x10.png">+ <a class="lightbox" href="/images/d-logo-sketch.png" data-download-href="//discourse.local/uploads/default/ad768537789cdf4679a18161ac0b0b6f0f4ccf9e" title="image">+ <img src="/images/d-logo-sketch-small.png" alt="image" data-base62-sha1="oKwwVE8qLWFBkE5UJeCs2EwxHHg" width="690" height="387" srcset="/images/d-logo-sketch-small.png" data-small-upload="/images/d-logo-sketch-small.png"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1500×842 234 KB</span>@@ -42,7 +42,7 @@ acceptance("Lightbox", function (needs) {assert.equal(query(".image-source-link:nth-child(2)").href,- "http://discourse.local/uploads/default/original/1X/ad768537789cdf4679a18161ac0b0b6f0f4ccf9e.jpeg"+ `${document.location.origin}/images/d-logo-sketch.png`);await click(".mfp-close");diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-test.jsindex b09d7525e9a..deb10d34ab8 100644--- a/app/assets/javascripts/discourse/tests/acceptance/topic-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-test.js@@ -186,7 +186,7 @@ acceptance("Topic", function (needs) {);});- test("Updating the topic title with unicode emojis without whitespaces", async function (assert) {+ test("Updating the topic title with unicode emojis without whitespace", async function (assert) {this.siteSettings.enable_inline_emoji_translation = true;await visit("/t/internationalization-localization/280");await click("#topic-title .d-icon-pencil-alt");@@ -694,7 +694,7 @@ acceptance("Topic stats update automatically", function () {id: 1,username: "test",name: "Mr. Tester",- avatar_template: "http://www.example.com/avatar/updated_avatar.png",+ avatar_template: "/images/d-logo-sketch-small.png",},};@@ -754,7 +754,7 @@ acceptance("Topic stats update automatically", function () {);assert.equal(newAvatarSrc,- postsChangedFixture.last_poster.avatar_template,+ `${document.location.origin}${postsChangedFixture.last_poster.avatar_template}`,"it updates the last poster avatar src with the expected value");});diff --git a/app/assets/javascripts/discourse/tests/unit/lib/text-direction-test.js b/app/assets/javascripts/discourse/tests/unit/lib/text-direction-test.jsindex 6a6e28c7a8a..2b736ecc310 100644--- a/app/assets/javascripts/discourse/tests/unit/lib/text-direction-test.js+++ b/app/assets/javascripts/discourse/tests/unit/lib/text-direction-test.js@@ -5,14 +5,14 @@ function quoteHtml() {return `<aside class="quote"><div class="title">- <img src="avatar.png"> osama:+ <img src="/images/avatar.png"> osama:</div><blockquote><p>كلمات بالعربي هنا</p><p>English words here!!</p><aside class="quote"><div class="title">- <img src="avatar.png"> أسامة:+ <img src="/images/avatar.png"> أسامة:</div><blockquote><p>English words here (nested quote)</p>diff --git a/plugins/discourse-presence/test/javascripts/acceptance/discourse-presence-test.js b/plugins/discourse-presence/test/javascripts/acceptance/discourse-presence-test.jsindex d29f166ca51..72c9d9e18f0 100644--- a/plugins/discourse-presence/test/javascripts/acceptance/discourse-presence-test.js+++ b/plugins/discourse-presence/test/javascripts/acceptance/discourse-presence-test.js@@ -161,7 +161,7 @@ acceptance("Discourse Presence Plugin", function (needs) {await joinChannel("/discourse-presence/reply/280", {id: 123,- avatar_template: "/a/b/c.jpg",+ avatar_template: "/images/avatar.png",username: "my-username",});@@ -169,7 +169,7 @@ acceptance("Discourse Presence Plugin", function (needs) {await joinChannel("/discourse-presence/whisper/280", {id: 124,- avatar_template: "/a/b/c.jpg",+ avatar_template: "/images/avatar.png",username: "my-username2",});@@ -198,7 +198,7 @@ acceptance("Discourse Presence Plugin", function (needs) {await joinChannel("/discourse-presence/reply/280", {id: 123,- avatar_template: "/a/b/c.jpg",+ avatar_template: "/images/avatar.png",username: "my-username",});@@ -206,7 +206,7 @@ acceptance("Discourse Presence Plugin", function (needs) {await joinChannel("/discourse-presence/whisper/280", {id: 124,- avatar_template: "/a/b/c.jpg",+ avatar_template: "/images/avatar.png",username: "my-username2",});