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:
@@ -90,4 +90,4 @@ describe('AppHeader', () => {
|
||||
await userEvent.click(screen.getByRole('button', { name: /^about$/i }));
|
||||
expect(useAppStore.getState().modal).toEqual({ kind: 'about' });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -12,7 +12,12 @@ vi.mock('@/components/ui/resizable', () => ({
|
||||
</div>
|
||||
),
|
||||
ResizablePanel: ({ children, defaultSize, minSize, maxSize }: any) => (
|
||||
<div data-testid="resizable-panel" data-size={defaultSize} data-min={minSize} data-max={maxSize}>
|
||||
<div
|
||||
data-testid="resizable-panel"
|
||||
data-size={defaultSize}
|
||||
data-min={minSize}
|
||||
data-max={maxSize}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
),
|
||||
@@ -46,4 +51,4 @@ describe('AppShell', () => {
|
||||
);
|
||||
expect(screen.queryByText(/file tree placeholder/i)).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,8 +9,15 @@ describe('Breadcrumb', () => {
|
||||
beforeEach(() => {
|
||||
localStorage.clear();
|
||||
useSettingsStore.setState({ ...useSettingsStore.getInitialState(), breadcrumbSymbols: true });
|
||||
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: '# H1\n## H2', dirty: false }]]) } as any);
|
||||
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: '# H1\n## H2', dirty: false }],
|
||||
]),
|
||||
} as any);
|
||||
});
|
||||
|
||||
it('shows "No file selected" when no tab is active', () => {
|
||||
@@ -38,8 +45,23 @@ describe('Breadcrumb', () => {
|
||||
});
|
||||
|
||||
it('limits heading symbols to 3', () => {
|
||||
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: '# H1\n## H2\n### H3\n#### H4', dirty: false }]]) } as any);
|
||||
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: '# H1\n## H2\n### H3\n#### H4',
|
||||
dirty: false,
|
||||
},
|
||||
],
|
||||
]),
|
||||
} as any);
|
||||
render(<Breadcrumb />);
|
||||
// Should show H1, H2, H3 but not H4
|
||||
expect(screen.getByText(/# H1/)).toBeInTheDocument();
|
||||
@@ -47,4 +69,4 @@ describe('Breadcrumb', () => {
|
||||
expect(screen.getByText(/# H3/)).toBeInTheDocument();
|
||||
expect(screen.queryByText(/# H4/)).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,4 +7,4 @@ describe('StatusBar', () => {
|
||||
render(<StatusBar />);
|
||||
expect(screen.getByText(/0 words/i)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -81,9 +81,7 @@ describe('TabBar', () => {
|
||||
|
||||
it('renders a dirty indicator when dirty === true', () => {
|
||||
useFileStore.setState({
|
||||
openTabs: [
|
||||
{ id: '/tmp/foo.md', path: '/tmp/foo.md', title: 'foo.md', dirty: true },
|
||||
],
|
||||
openTabs: [{ id: '/tmp/foo.md', path: '/tmp/foo.md', title: 'foo.md', dirty: true }],
|
||||
activeTabId: '/tmp/foo.md',
|
||||
});
|
||||
render(<TabBar />);
|
||||
|
||||
Reference in New Issue
Block a user