Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

1.3 KB
Raw Blame
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
import { createPinia, setActivePinia } from "pinia";
import { useSettingsStore } from "@/stores/settingsStore";

const globalsCss = readFileSync(new URL("../globals.css", import.meta.url), "utf8");

describe("font smoothing setting (#13359)", () => {
  it("defaults to off and round-trips through the settings store", () => {
    const pinia = createPinia();
    setActivePinia(pinia);
    const settings = useSettingsStore();
    expect(settings.editorSettings.fontSmoothing).toBe(false);

    settings.updateEditorSettings({ fontSmoothing: true });
    expect(settings.editorSettings.fontSmoothing).toBe(true);
    settings.updateEditorSettings({ fontSmoothing: false });
    expect(settings.editorSettings.fontSmoothing).toBe(false);
  });

  it("only applies smoothing under the opt-in class", () => {
    // The base body rule keeps the platform default; smoothing lives behind
    // html.dbx-font-smoothing so the off state is byte-identical to pre-#13359.
    expect(globalsCss).toContain("html.dbx-font-smoothing body");
    expect(globalsCss).toContain("-webkit-font-smoothing: antialiased");
    const bodyRule = globalsCss.match(/body \{[^}]*\}/)?.[0] ?? "";
    expect(bodyRule).not.toContain("font-smoothing");
  });
});