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:
@@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user