mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 22:34:42 +08:00
Remove Discourse.SiteSettings
from tests (#10193)
* Remove unused Discourse.SiteSettings * Remove `Discourse.SiteSettings` from many tests * REFACTOR: `lib:formatter` was using a lot of leaky state * Remove more `Discourse.SiteSettings` from tests * More SiteSettings removed from tests
This commit is contained in:
@ -1,21 +1,22 @@
|
||||
import { emojiSearch } from "pretty-text/emoji";
|
||||
import { IMAGE_VERSION as v } from "pretty-text/emoji/version";
|
||||
import { emojiUnescape } from "discourse/lib/text";
|
||||
import { discourseModule } from "helpers/qunit-helpers";
|
||||
|
||||
QUnit.module("lib:emoji");
|
||||
discourseModule("lib:emoji");
|
||||
|
||||
QUnit.test("emojiUnescape", assert => {
|
||||
QUnit.test("emojiUnescape", function(assert) {
|
||||
const testUnescape = (input, expected, description, settings = {}) => {
|
||||
const originalSettings = {};
|
||||
for (const [key, value] of Object.entries(settings)) {
|
||||
originalSettings[key] = Discourse.SiteSettings[key];
|
||||
Discourse.SiteSettings[key] = value;
|
||||
originalSettings[key] = this.siteSettings[key];
|
||||
this.siteSettings[key] = value;
|
||||
}
|
||||
|
||||
assert.equal(emojiUnescape(input), expected, description);
|
||||
|
||||
for (const [key, value] of Object.entries(originalSettings)) {
|
||||
Discourse.SiteSettings[key] = value;
|
||||
this.siteSettings[key] = value;
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user