Fix Emmet removeTag tests

Ref https://github.com/microsoft/vscode/issues/138063
This commit is contained in:
Raymond Zhao 2021-11-29 12:09:57 -08:00
parent d5bfd6d31c
commit dd56064202
No known key found for this signature in database
GPG key ID: D36E5FCE46B63B58

View file

@ -27,6 +27,22 @@ suite('Tests for Emmet actions on html tags', () => {
</div>
`;
const spacedContents = `
<div class="hello">
<ul>
<li><span>Hello</span></li>
<li><span>There</span></li>
<div><li><span>Bye</span></li></div>
</ul>
<span/>
</div>
`;
let contentsWithTemplate = `
<script type="text/template">
<ul>
@ -168,11 +184,9 @@ suite('Tests for Emmet actions on html tags', () => {
test('remove tag with template', () => {
const expectedContents = `
<script type="text/template">
\t\t
<li><span>Hello</span></li>
<li><span>There</span></li>
<div><li><span>Bye</span></li></div>
\t\t
<span/>
</script>
`;
@ -187,6 +201,29 @@ suite('Tests for Emmet actions on html tags', () => {
});
});
});
test('remove tag with extra trim', () => {
const expectedContents = `
<div class="hello">
<li><span>Hello</span></li>
<li><span>There</span></li>
<div><li><span>Bye</span></li></div>
<span/>
</div>
`;
return withRandomFileEditor(spacedContents, 'html', (editor, doc) => {
editor.selections = [
new Selection(2, 4, 2, 4), // cursor inside ul tag
];
return removeTag()!.then(() => {
assert.strictEqual(doc.getText(), expectedContents);
return Promise.resolve();
});
});
});
// #endregion
// #region split/join tag