mirror of
https://github.com/Microsoft/vscode
synced 2024-10-12 06:17:18 +00:00
Fix Emmet removeTag tests
Ref https://github.com/microsoft/vscode/issues/138063
This commit is contained in:
parent
d5bfd6d31c
commit
dd56064202
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue