diff --git a/src/App.test.tsx b/src/App.test.tsx index 79c2a9a6..2f7815b3 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -372,9 +372,9 @@ vi.mock('@blocknote/core/extensions', () => ({ vi.mock('@blocknote/react', () => ({ createReactBlockSpec: () => () => ({}), createReactInlineContentSpec: () => ({ render: () => null }), - BlockNoteViewRaw: ({ children }: { children?: ReactNode }) => ( -
-
+ BlockNoteViewRaw: ({ children, editable }: { children?: ReactNode; editable?: boolean }) => ( +
+
mock editor
{children} @@ -578,6 +578,7 @@ describe('App', () => { await waitFor(() => expect(getNoteContent).toHaveBeenCalled()) expect(getNoteContent).toHaveBeenCalledWith({ path: '/vault/project/test.md', vaultPath: '/vault' }) await waitFor(() => expect(window.__laputaTest?.activeTabPath).toBe('/vault/project/test.md')) + expect(screen.getByTestId('blocknote-view')).toHaveAttribute('data-editable', 'true') expect(listVault).not.toHaveBeenCalled() }) diff --git a/src/App.tsx b/src/App.tsx index 08e3645d..59766b92 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1690,7 +1690,7 @@ function App() { tabs={notes.tabs} activeTabPath={notes.activeTabPath} isVaultLoading={isVaultContentLoading} - entries={vault.entries} + entries={noteWindowParams && activeTab ? [activeTab.entry] : vault.entries} onNavigateWikilink={notes.handleNavigateWikilink} onLoadDiff={vault.loadDiff} onLoadDiffAtCommit={vault.loadDiffAtCommit}