mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-10 13:51:45 +00:00
fix(file-manager): cancel uploads and stop remote writes (#1477)
* fix(file-manager): cancel uploads and stop remote writes * test(css): exercise the configured PostCSS plugin chain
This commit is contained in:
1 parent
26d52c7631
commit
2a2ba2f790
6 files changed
+283
-16
No files matched your search
@@ -1,21 +1,24 @@
|
||||
import { createRequire } from "node:module";
|
||||
import postcss from "postcss";
|
||||
import postcss, { type AcceptedPlugin } from "postcss";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const config = require("../postcss.config.cjs") as {
|
||||
plugins: Record<string, unknown>;
|
||||
plugins: AcceptedPlugin[];
|
||||
};
|
||||
const pxtorem = require("postcss-pxtorem");
|
||||
|
||||
async function convert(css: string, from = "src/ui/index.css") {
|
||||
const result = await postcss([
|
||||
pxtorem(config.plugins["postcss-pxtorem"]),
|
||||
]).process(css, { from });
|
||||
const result = await postcss(config.plugins).process(css, { from });
|
||||
return result.css;
|
||||
}
|
||||
|
||||
describe("interface size conversion", () => {
|
||||
it("preserves circular radii emitted in exponent notation", async () => {
|
||||
expect(await convert(".a{border-radius:3.40282e38px}")).toBe(
|
||||
".a{border-radius:calc(infinity * 1px)}",
|
||||
);
|
||||
});
|
||||
|
||||
it("turns px into rem against the 14px Normal root", async () => {
|
||||
expect(await convert(".a{font-size:10px;width:280px}")).toBe(
|
||||
".a{font-size:0.71429rem;width:20rem}",
|
||||
|
||||
Reference in new issue
Block a user