mnaoumov_obsidian-backlink-.../src/plugin-settings.test.ts
Michael Naumov f32bbb7b58 refactor!: migrate to obsidian-dev-utils v2 component architecture
- Delete PluginTypes.ts and remove generic from PluginBase
- Convert PluginSettingsManager to PluginSettingsComponent with DI params
- Use constructor registerComponent() pattern for settings and settings tab
- Replace onSaveSettings override with event subscription on settings component
- Rename all source files to kebab-case (Plugin.ts -> plugin.ts, etc.)
- Add vitest test infrastructure with jsdom environment and obsidian-test-mocks
- Add 14 tests covering settings defaults, component creation, and plugin construction
- Update tsconfig: remove allowJs, svelte types; add vitest.config.ts to include
- Add obsidian-test-mocks, sass-embedded, vitest, jsdom as dev dependencies

BREAKING CHANGE: Requires obsidian-dev-utils v2 (component architecture).
2026-04-22 02:31:42 -06:00

50 lines
1.4 KiB
TypeScript

/**
* @file
*
* Tests for PluginSettings default values.
*/
import {
describe,
expect,
it
} from 'vitest';
import { PluginSettings } from './plugin-settings.ts';
describe('PluginSettings', () => {
it('should have correct default pathDepth', () => {
const settings = new PluginSettings();
expect(settings.pathDepth).toBe(0);
});
it('should have correct default rootPaths', () => {
const settings = new PluginSettings();
expect(settings.rootPaths).toEqual([]);
});
it('should have correct default shouldDisplayParentPathOnSeparateLine', () => {
const settings = new PluginSettings();
expect(settings.shouldDisplayParentPathOnSeparateLine).toBe(false);
});
it('should have correct default shouldHighlightFileName', () => {
const settings = new PluginSettings();
expect(settings.shouldHighlightFileName).toBe(true);
});
it('should have correct default shouldIncludeExtension', () => {
const settings = new PluginSettings();
expect(settings.shouldIncludeExtension).toBe(true);
});
it('should have correct default shouldReversePathParts', () => {
const settings = new PluginSettings();
expect(settings.shouldReversePathParts).toBe(false);
});
it('should have correct default shouldShowEllipsisForSkippedPathParts', () => {
const settings = new PluginSettings();
expect(settings.shouldShowEllipsisForSkippedPathParts).toBe(true);
});
});