FIX: wrong url for default logos in header on subfolder installs

This commit is contained in:
Neil Lalonde
2018-07-13 14:20:24 -04:00
parent b1082924b9
commit 8ceed642cb
2 changed files with 52 additions and 3 deletions

View File

@@ -96,3 +96,52 @@ widgetTest("mobile without logo", {
assert.equal(this.$("#site-logo").attr("src"), bigLogo);
}
});
widgetTest("basics, subfolder", {
template: '{{mount-widget widget="home-logo" args=args}}',
beforeEach() {
Discourse.BaseUri = "/forum";
this.siteSettings.logo_url = bigLogo;
this.siteSettings.logo_small_url = smallLogo;
this.siteSettings.title = title;
this.set("args", { minimized: false });
},
test(assert) {
assert.ok(this.$("img#site-logo.logo-big").length === 1);
assert.equal(this.$("#site-logo").attr("src"), `/forum${bigLogo}`);
assert.equal(this.$("#site-logo").attr("alt"), title);
}
});
widgetTest("basics, subfolder - minimized", {
template: '{{mount-widget widget="home-logo" args=args}}',
beforeEach() {
Discourse.BaseUri = "/forum";
this.siteSettings.logo_url = bigLogo;
this.siteSettings.logo_small_url = smallLogo;
this.siteSettings.title = title;
this.set("args", { minimized: true });
},
test(assert) {
assert.ok(this.$("img.logo-small").length === 1);
assert.equal(this.$("img.logo-small").attr("src"), `/forum${smallLogo}`);
assert.equal(this.$("img.logo-small").attr("alt"), title);
}
});
widgetTest("mobile logo, subfolder", {
template: '{{mount-widget widget="home-logo" args=args}}',
beforeEach() {
Discourse.BaseUri = "/forum";
this.siteSettings.mobile_logo_url = mobileLogo;
this.siteSettings.logo_small_url = smallLogo;
this.site.mobileView = true;
},
test(assert) {
assert.ok(this.$("img#site-logo.logo-big").length === 1);
assert.equal(this.$("#site-logo").attr("src"), `/forum${mobileLogo}`);
}
});