FIX: More 404 image requests in test

A few tests were removed that were testing a subforum for the logo,
which I don't think gain us much anymore. We use `getURL` everywhere and
needn't test it so much. Plus, over time it's always good to remove
a few tests here and there :)
This commit is contained in:
Robin Ward 2020-07-17 14:57:25 -04:00
parent bf22f7080d
commit 2a4a2a2ab7
3 changed files with 5 additions and 56 deletions

View File

@ -3,7 +3,7 @@ moduleForComponent("image-uploader", { integration: true });
componentTest("with image", {
template:
"{{image-uploader imageUrl='/some/upload.png' placeholderUrl='/not/used.png'}}",
"{{image-uploader imageUrl='/images/avatar.png' placeholderUrl='/not/used.png'}}",
async test(assert) {
assert.equal(

View File

@ -1519,20 +1519,20 @@ QUnit.test("emoji - emojiSet", assert => {
});
QUnit.test("emoji - registerEmoji", assert => {
registerEmoji("foo", "/foo.png");
registerEmoji("foo", "/images/d-logo-sketch.png");
assert.cookedOptions(
":foo:",
{},
`<p><img src="/foo.png?v=${v}" title=":foo:" class="emoji emoji-custom only-emoji" alt=":foo:"></p>`
`<p><img src="/images/d-logo-sketch.png?v=${v}" title=":foo:" class="emoji emoji-custom only-emoji" alt=":foo:"></p>`
);
registerEmoji("bar", "/bar.png", "baz");
registerEmoji("bar", "/images/avatar.png", "baz");
assert.cookedOptions(
":bar:",
{},
`<p><img src="/bar.png?v=${v}" title=":bar:" class="emoji emoji-custom only-emoji" alt=":bar:"></p>`
`<p><img src="/images/avatar.png?v=${v}" title=":bar:" class="emoji emoji-custom only-emoji" alt=":bar:"></p>`
);
});

View File

@ -1,6 +1,4 @@
import { moduleForWidget, widgetTest } from "helpers/widget-test";
import { setPrefix } from "discourse-common/lib/get-url";
moduleForWidget("home-logo");
const bigLogo = "/images/d-logo-sketch.png?test";
@ -98,52 +96,3 @@ widgetTest("mobile without logo", {
assert.equal(find("#site-logo").attr("src"), bigLogo);
}
});
widgetTest("basics, subfolder", {
template: '{{mount-widget widget="home-logo" args=args}}',
beforeEach() {
setPrefix("/forum");
this.siteSettings.site_logo_url = bigLogo;
this.siteSettings.site_logo_small_url = smallLogo;
this.siteSettings.title = title;
this.set("args", { minimized: false });
},
test(assert) {
assert.ok(find("img#site-logo.logo-big").length === 1);
assert.equal(find("#site-logo").attr("src"), `/forum${bigLogo}`);
assert.equal(find("#site-logo").attr("alt"), title);
}
});
widgetTest("basics, subfolder - minimized", {
template: '{{mount-widget widget="home-logo" args=args}}',
beforeEach() {
setPrefix("/forum");
this.siteSettings.site_logo_url = bigLogo;
this.siteSettings.site_logo_small_url = smallLogo;
this.siteSettings.title = title;
this.set("args", { minimized: true });
},
test(assert) {
assert.ok(find("img.logo-small").length === 1);
assert.equal(find("img.logo-small").attr("src"), `/forum${smallLogo}`);
assert.equal(find("img.logo-small").attr("alt"), title);
}
});
widgetTest("mobile logo, subfolder", {
template: '{{mount-widget widget="home-logo" args=args}}',
beforeEach() {
setPrefix("/forum");
this.siteSettings.site_mobile_logo_url = mobileLogo;
this.siteSettings.site_logo_small_url = smallLogo;
this.site.mobileView = true;
},
test(assert) {
assert.ok(find("img#site-logo.logo-big").length === 1);
assert.equal(find("#site-logo").attr("src"), `/forum${mobileLogo}`);
}
});