Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test showing section issue #30

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/__tests__/pure-get-edits.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,34 @@ describe("pureGetEdits", () => {
],
});
});

it("updates files linking to a section in the moved file in a table", () => {
testRename({
payload: {
pathBefore: "folder/file-2.md",
pathAfter: "folder/newfolder/file-2.md",
},
markdownFiles: [
{
path: "file-1.md",
content:
"# File 1\n| a link [link to file-2](folder/file-2.md#heading) | is \"here\" |",
},
{
path: "folder/newfolder/file-2.md",
content: "# Just some markdown file\n## Heading",
},
],
expectedEdits: [
{
path: "file-1.md",
range: "1:26-1:50",
newText: "folder/newfolder/file-2.md#heading",
},
],
});
});

});

describe("save", () => {
Expand Down