style: run prettier formatter over src and tests

This commit is contained in:
2026-06-11 20:46:00 +05:30
parent 2389d4f297
commit 6b564a4569
211 changed files with 6134 additions and 4234 deletions
+4 -1
View File
@@ -53,7 +53,10 @@ describe('useAppStore (modal)', () => {
it('openModal with kind requiring props passes them through', () => {
useAppStore.getState().openModal('export-pdf', { sourcePath: '/a.md' });
expect(useAppStore.getState().modal).toEqual({ kind: 'export-pdf', props: { sourcePath: '/a.md' } });
expect(useAppStore.getState().modal).toEqual({
kind: 'export-pdf',
props: { sourcePath: '/a.md' },
});
});
it('closeModal clears the modal state', () => {
+1 -1
View File
@@ -44,4 +44,4 @@ describe('useEditorStore', () => {
expect(newBuf?.path).toBe('/bar.md');
expect(useEditorStore.getState().activeId).toBe('file-2');
});
});
});
+15 -5
View File
@@ -54,7 +54,9 @@ describe('file-store toasts', () => {
openTabs: [{ id: '/test.md', path: '/test.md', title: 'test.md', dirty: false }],
} as any);
useEditorStore.setState({
buffers: new Map([['/test.md', { id: '/test.md', path: '/test.md', content: '# hi', dirty: true }]]),
buffers: new Map([
['/test.md', { id: '/test.md', path: '/test.md', content: '# hi', dirty: true }],
]),
activeId: '/test.md',
} as any);
@@ -64,13 +66,18 @@ describe('file-store toasts', () => {
});
it('calls toast.error when save fails', async () => {
fakeWrite.mockResolvedValue({ ok: false, error: { code: 'EACCES', message: 'Permission denied' } });
fakeWrite.mockResolvedValue({
ok: false,
error: { code: 'EACCES', message: 'Permission denied' },
});
useFileStore.setState({
activeTabId: '/test.md',
openTabs: [{ id: '/test.md', path: '/test.md', title: 'test.md', dirty: false }],
} as any);
useEditorStore.setState({
buffers: new Map([['/test.md', { id: '/test.md', path: '/test.md', content: '# hi', dirty: true }]]),
buffers: new Map([
['/test.md', { id: '/test.md', path: '/test.md', content: '# hi', dirty: true }],
]),
activeId: '/test.md',
} as any);
@@ -91,10 +98,13 @@ describe('file-store toasts', () => {
describe('openFolder', () => {
it('calls toast.error when IPC list fails', async () => {
fakeList.mockResolvedValue({ ok: false, error: { code: 'EACCES', message: 'Permission denied' } });
fakeList.mockResolvedValue({
ok: false,
error: { code: 'EACCES', message: 'Permission denied' },
});
await useFileStore.getState().openFolder('/forbidden');
expect(toast.error).toHaveBeenCalledWith('Failed to open folder: Permission denied');
});
});
});
});
+4 -5
View File
@@ -49,10 +49,7 @@ describe('useFileStore', () => {
it('openFolder calls ipc.file.list and sets tree with root node and mapped children', async () => {
fakeList.mockResolvedValue({
ok: true,
data: [
fakeFileEntry('README.md', false),
fakeFileEntry('src', true),
],
data: [fakeFileEntry('README.md', false), fakeFileEntry('src', true)],
});
await useFileStore.getState().openFolder('/root');
@@ -139,7 +136,9 @@ describe('useFileStore', () => {
path: '/root',
isDirectory: true,
loaded: true,
children: [{ name: 'src', path: '/root/src', isDirectory: true, children: null, loaded: true }],
children: [
{ name: 'src', path: '/root/src', isDirectory: true, children: null, loaded: true },
],
};
useFileStore.setState({ tree });
+1 -1
View File
@@ -41,4 +41,4 @@ describe('useSettingsStore', () => {
expect(parsed.state.setSetting).toBeUndefined();
expect(parsed.state.resetToDefaults).toBeUndefined();
});
});
});