mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 22:34:42 +08:00
Revert "Rename all test files from JS -> ES6"
This reverts commit 2abe85b8344de1102c1589a9ac9421a8b296f2b5.
This commit is contained in:
@ -1,148 +0,0 @@
|
||||
import { moduleForWidget, widgetTest } from "helpers/widget-test";
|
||||
|
||||
moduleForWidget("home-logo");
|
||||
|
||||
const bigLogo = "/images/d-logo-sketch.png?test";
|
||||
const smallLogo = "/images/d-logo-sketch-small.png?test";
|
||||
const mobileLogo = "/images/d-logo-sketch.png?mobile";
|
||||
const title = "Cool Forum";
|
||||
|
||||
widgetTest("basics", {
|
||||
template: '{{mount-widget widget="home-logo" args=args}}',
|
||||
skip: true,
|
||||
beforeEach() {
|
||||
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(".title").length === 1);
|
||||
|
||||
assert.ok(find("img#site-logo.logo-big").length === 1);
|
||||
assert.equal(find("#site-logo").attr("src"), bigLogo);
|
||||
assert.equal(find("#site-logo").attr("alt"), title);
|
||||
}
|
||||
});
|
||||
|
||||
widgetTest("basics - minimized", {
|
||||
template: '{{mount-widget widget="home-logo" args=args}}',
|
||||
beforeEach() {
|
||||
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"), smallLogo);
|
||||
assert.equal(find("img.logo-small").attr("alt"), title);
|
||||
}
|
||||
});
|
||||
|
||||
widgetTest("no logo", {
|
||||
template: '{{mount-widget widget="home-logo" args=args}}',
|
||||
beforeEach() {
|
||||
this.siteSettings.site_logo_url = "";
|
||||
this.siteSettings.site_logo_small_url = "";
|
||||
this.siteSettings.title = title;
|
||||
this.set("args", { minimized: false });
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
assert.ok(find("h1#site-text-logo.text-logo").length === 1);
|
||||
assert.equal(find("#site-text-logo").text(), title);
|
||||
}
|
||||
});
|
||||
|
||||
widgetTest("no logo - minimized", {
|
||||
template: '{{mount-widget widget="home-logo" args=args}}',
|
||||
beforeEach() {
|
||||
this.siteSettings.site_logo_url = "";
|
||||
this.siteSettings.site_logo_small_url = "";
|
||||
this.siteSettings.title = title;
|
||||
this.set("args", { minimized: true });
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
assert.ok(find(".d-icon-home").length === 1);
|
||||
}
|
||||
});
|
||||
|
||||
widgetTest("mobile logo", {
|
||||
template: '{{mount-widget widget="home-logo" args=args}}',
|
||||
beforeEach() {
|
||||
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"), mobileLogo);
|
||||
}
|
||||
});
|
||||
|
||||
widgetTest("mobile without logo", {
|
||||
template: '{{mount-widget widget="home-logo" args=args}}',
|
||||
beforeEach() {
|
||||
this.siteSettings.site_logo_url = bigLogo;
|
||||
this.site.mobileView = true;
|
||||
},
|
||||
|
||||
test(assert) {
|
||||
assert.ok(find("img#site-logo.logo-big").length === 1);
|
||||
assert.equal(find("#site-logo").attr("src"), bigLogo);
|
||||
}
|
||||
});
|
||||
|
||||
widgetTest("basics, subfolder", {
|
||||
template: '{{mount-widget widget="home-logo" args=args}}',
|
||||
beforeEach() {
|
||||
Discourse.BaseUri = "/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() {
|
||||
Discourse.BaseUri = "/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() {
|
||||
Discourse.BaseUri = "/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}`);
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user