mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
style: run prettier formatter over src and tests
This commit is contained in:
@@ -10,8 +10,13 @@ describe('modal commands', () => {
|
||||
localStorage.clear();
|
||||
useCommandStore.setState({ handlers: {}, userBindings: {} } as any);
|
||||
useAppStore.setState({ modal: { kind: null } } as any);
|
||||
useFileStore.setState({ activeTabId: '/x.md', openTabs: [{ id: '/x.md', path: '/x.md', title: 'x.md', dirty: false }] } as any);
|
||||
useEditorStore.setState({ buffers: new Map([['/x.md', { id: '/x.md', path: '/x.md', content: '# hi', dirty: false }]]) } as any);
|
||||
useFileStore.setState({
|
||||
activeTabId: '/x.md',
|
||||
openTabs: [{ id: '/x.md', path: '/x.md', title: 'x.md', dirty: false }],
|
||||
} as any);
|
||||
useEditorStore.setState({
|
||||
buffers: new Map([['/x.md', { id: '/x.md', path: '/x.md', content: '# hi', dirty: false }]]),
|
||||
} as any);
|
||||
});
|
||||
|
||||
it('settings.open opens settings modal', () => {
|
||||
@@ -35,19 +40,34 @@ describe('modal commands', () => {
|
||||
it('file.exportPdf opens export-pdf modal with active path', () => {
|
||||
registerMenuCommands();
|
||||
useCommandStore.getState().dispatch('file.exportPdf');
|
||||
expect(useAppStore.getState().modal).toEqual({ kind: 'export-pdf', props: { sourcePath: '/x.md' } });
|
||||
expect(useAppStore.getState().modal).toEqual({
|
||||
kind: 'export-pdf',
|
||||
props: { sourcePath: '/x.md' },
|
||||
});
|
||||
});
|
||||
|
||||
it('file.exportDocx opens export-docx modal', () => {
|
||||
registerMenuCommands();
|
||||
useCommandStore.getState().dispatch('file.exportDocx');
|
||||
expect(useAppStore.getState().modal).toEqual({ kind: 'export-docx', props: { sourcePath: '/x.md' } });
|
||||
expect(useAppStore.getState().modal).toEqual({
|
||||
kind: 'export-docx',
|
||||
props: { sourcePath: '/x.md' },
|
||||
});
|
||||
});
|
||||
|
||||
it('file.exportBatch opens export-batch modal with all open files', () => {
|
||||
useFileStore.setState({ activeTabId: '/x.md', openTabs: [{ id: '/x.md', path: '/x.md', title: 'x.md', dirty: false }, { id: '/y.md', path: '/y.md', title: 'y.md', dirty: false }] } as any);
|
||||
useFileStore.setState({
|
||||
activeTabId: '/x.md',
|
||||
openTabs: [
|
||||
{ id: '/x.md', path: '/x.md', title: 'x.md', dirty: false },
|
||||
{ id: '/y.md', path: '/y.md', title: 'y.md', dirty: false },
|
||||
],
|
||||
} as any);
|
||||
registerMenuCommands();
|
||||
useCommandStore.getState().dispatch('file.exportBatch');
|
||||
expect(useAppStore.getState().modal).toEqual({ kind: 'export-batch', props: { sourcePaths: ['/x.md', '/y.md'] } });
|
||||
expect(useAppStore.getState().modal).toEqual({
|
||||
kind: 'export-batch',
|
||||
props: { sourcePaths: ['/x.md', '/y.md'] },
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,7 +10,10 @@ describe('Phase 9 commands', () => {
|
||||
localStorage.clear();
|
||||
useCommandStore.setState({ handlers: {}, userBindings: {} } as any);
|
||||
useAppStore.setState({ modal: { kind: null } } as any);
|
||||
useFileStore.setState({ activeTabId: '/x.md', openTabs: [{ id: '/x.md', path: '/x.md', title: 'x.md', dirty: false }] } as any);
|
||||
useFileStore.setState({
|
||||
activeTabId: '/x.md',
|
||||
openTabs: [{ id: '/x.md', path: '/x.md', title: 'x.md', dirty: false }],
|
||||
} as any);
|
||||
// Use resetToDefaults to restore store methods (setSetting/resetToDefaults)
|
||||
useSettingsStore.getState().resetToDefaults();
|
||||
});
|
||||
@@ -36,7 +39,10 @@ describe('Phase 9 commands', () => {
|
||||
it('tools.exportWord opens export-word modal with active path', () => {
|
||||
registerMenuCommands();
|
||||
useCommandStore.getState().dispatch('tools.exportWord');
|
||||
expect(useAppStore.getState().modal).toEqual({ kind: 'export-word', props: { sourcePath: '/x.md' } });
|
||||
expect(useAppStore.getState().modal).toEqual({
|
||||
kind: 'export-word',
|
||||
props: { sourcePath: '/x.md' },
|
||||
});
|
||||
});
|
||||
|
||||
it('tools.repl toggles replOpen setting', () => {
|
||||
@@ -47,4 +53,4 @@ describe('Phase 9 commands', () => {
|
||||
useCommandStore.getState().dispatch('tools.repl');
|
||||
expect(useSettingsStore.getState().replOpen).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user