Default to system emoji font (#11925)
* Disable Twemoji emoji font by default Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Force Twemoji font in SAS Verification Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Add tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Improve tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
a6705304aa
commit
ee485ffcfd
13 changed files with 119 additions and 114 deletions
|
@ -17,22 +17,26 @@ limitations under the License.
|
|||
import { Action } from "../../../src/dispatcher/actions";
|
||||
import dis from "../../../src/dispatcher/dispatcher";
|
||||
import SystemFontController from "../../../src/settings/controllers/SystemFontController";
|
||||
import { SettingLevel } from "../../../src/settings/SettingLevel";
|
||||
import SettingsStore from "../../../src/settings/SettingsStore";
|
||||
|
||||
const dispatchSpy = jest.spyOn(dis, "dispatch");
|
||||
|
||||
describe("SystemFontController", () => {
|
||||
it("dispatches a font size action on change", () => {
|
||||
const getValueSpy = jest.spyOn(SettingsStore, "getValue").mockReturnValue(true);
|
||||
it("dispatches a system font update action on change", () => {
|
||||
const controller = new SystemFontController();
|
||||
|
||||
controller.onChange(SettingLevel.ACCOUNT, "$room:server", 12);
|
||||
const getValueSpy = jest.spyOn(SettingsStore, "getValue").mockImplementation((settingName) => {
|
||||
if (settingName === "useBundledEmojiFont") return false;
|
||||
if (settingName === "useSystemFont") return true;
|
||||
if (settingName === "systemFont") return "Comic Sans MS";
|
||||
});
|
||||
controller.onChange();
|
||||
|
||||
expect(dispatchSpy).toHaveBeenCalledWith({
|
||||
action: Action.UpdateSystemFont,
|
||||
useBundledEmojiFont: false,
|
||||
useSystemFont: true,
|
||||
font: 12,
|
||||
font: "Comic Sans MS",
|
||||
});
|
||||
|
||||
expect(getValueSpy).toHaveBeenCalledWith("useSystemFont");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue