forked from phenom/healer-man
Release Healer Man 0.1.22
This commit is contained in:
1 parent
f6f2375145
commit
7f6001723a
144 files changed
+54107
-690
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const styles = readFileSync(new URL("../styles.css", import.meta.url), "utf8");
|
||||
|
||||
function declarationBlock(selector: string): string {
|
||||
const escapedSelector = selector.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
return styles.match(new RegExp(`(?:^|\\n)\\s*${escapedSelector}\\s*\\{([^}]*)\\}`))?.[1] ?? "";
|
||||
}
|
||||
|
||||
describe("gameplay HUD layering", () => {
|
||||
it("contains world-space labels below the DOM HUD", () => {
|
||||
const sceneShell = declarationBlock(".scene-shell");
|
||||
const hud = declarationBlock(".hud");
|
||||
|
||||
expect(sceneShell).toMatch(/z-index:\s*0\s*;/);
|
||||
expect(sceneShell).toMatch(/isolation:\s*isolate\s*;/);
|
||||
expect(hud).toMatch(/z-index:\s*(?:[1-9]|[1-9]\d+)\s*;/);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user