mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
Strengthen sameNodes check 💪 fixes #112829
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user