mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-30 00:19:35 +00:00
28 lines
1.1 KiB
TypeScript
28 lines
1.1 KiB
TypeScript
import { readFileSync } from "node:fs";
|
|
import { strict as assert } from "node:assert";
|
|
import test from "node:test";
|
|
|
|
const source = readFileSync("src/components/editor/EditorSettingsDialog.vue", "utf8");
|
|
|
|
test("settings dialog uses a side category navigation", () => {
|
|
assert.match(source, /settingsCategoryNav/);
|
|
assert.match(source, /settingsCategoryButton/);
|
|
});
|
|
|
|
test("Redis scan size lives in its own settings category", () => {
|
|
const redisTab = source.indexOf('value: "redis"');
|
|
const redisContent = source.search(/activeSettingsTab === ['"]redis['"]/);
|
|
const redisScanSetting = source.indexOf('t("settings.redisScanPageSize")');
|
|
const editorContent = source.search(/activeSettingsTab === ['"]editor['"]/);
|
|
|
|
assert.ok(redisTab > -1);
|
|
assert.ok(redisContent > -1);
|
|
assert.ok(redisScanSetting > redisContent);
|
|
assert.ok(redisScanSetting > editorContent);
|
|
});
|
|
|
|
test("settings action footer stays at the bottom of the content pane", () => {
|
|
assert.match(source, /class="[^"]*min-h-full[^"]*flex-col[^"]*"/);
|
|
assert.match(source, /<DialogFooter class="[^"]*mt-auto[^"]*"/);
|
|
});
|