mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-06-29 01:45:54 +08:00
test: 移除 _markDirty 测试(函数已私有化,行为由 CRUD 测试间接覆盖)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -197,28 +197,6 @@ describe('undo/redo', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('_markDirty', () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
vi.clearAllMocks();
|
|
||||||
resetStore();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('修改后 isModified 为 true', () => {
|
|
||||||
useAppStore.setState({ _savedSys: [], sysPaths: [], _savedUser: [], userPaths: [] });
|
|
||||||
useAppStore.getState()._markDirty();
|
|
||||||
expect(useAppStore.getState().isModified).toBe(false); // 相等
|
|
||||||
});
|
|
||||||
|
|
||||||
it('路径变化时 isModified 为 true', () => {
|
|
||||||
useAppStore.setState({
|
|
||||||
_savedSys: ['A'], sysPaths: ['B'],
|
|
||||||
_savedUser: [], userPaths: [],
|
|
||||||
});
|
|
||||||
useAppStore.getState()._markDirty();
|
|
||||||
expect(useAppStore.getState().isModified).toBe(true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('loadPaths', () => {
|
describe('loadPaths', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
vi.clearAllMocks();
|
vi.clearAllMocks();
|
||||||
|
|||||||
Reference in New Issue
Block a user