Strengthen sameNodes check 💪 fixes #112829

This commit is contained in:
Raymond Zhao
2020-12-18 17:29:24 +00:00
committed by GitHub
parent 202a8fa3eb
commit ea15eb4e5a
2 changed files with 36 additions and 2 deletions

View File

@@ -726,4 +726,29 @@ suite('Tests for Toggle Comment action from Emmet in nested css (SCSS)', () => {
});
});
});
test('toggle comment doesn\'t fail when start and end nodes differ HTML', () => {
const contents = `
<div>
<p>Hello</p>
</div>
`;
const expectedContents = `
<!--<div>
<p>Hello</p>
</div>-->
`;
return withRandomFileEditor(contents, 'html', (editor, doc) => {
editor.selections = [
new Selection(1, 2, 2, 9), // <div> to <p> inclusive
];
return toggleComment().then(() => {
assert.equal(doc.getText(), expectedContents);
return toggleComment().then(() => {
assert.equal(doc.getText(), contents);
return Promise.resolve();
});
});
});
});
});