21 lines
987 B
JavaScript
21 lines
987 B
JavaScript
import assert from "node:assert/strict";
|
|
import { describe, it } from "node:test";
|
|
import { readFileSync } from "node:fs";
|
|
import { dirname, join } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
const source = readFileSync(join(__dirname, "OrgPermissionTree.vue"), "utf8");
|
|
|
|
describe("OrgPermissionTree hierarchy lines", () => {
|
|
it("draws connector lines only between each node and its direct children", () => {
|
|
assert.match(source, /\.org-tree-children\s*>\s*\.org-tree-branch\s*>\s*\.org-tree-node::before/);
|
|
assert.match(source, /\.org-tree-children\s*>\s*\.org-tree-branch\s*>\s*\.org-tree-node::after/);
|
|
assert.doesNotMatch(source, /\.org-tree-children::before/);
|
|
assert.doesNotMatch(source, /\.org-tree-branch::before/);
|
|
assert.match(source, /--tree-connector-x/);
|
|
assert.match(source, /--tree-connector-color/);
|
|
assert.match(source, /--tree-connector-width:\s*2px/);
|
|
});
|
|
});
|