提交 6f139c79 编写于 作者: R Ramya Achutha Rao

Test for multiline selection for wrap

上级 d8cce48e
......@@ -349,18 +349,46 @@ suite('Tests for Wrap with Abbreviations', () => {
});
});
test('Wrap individual lines with abbreviation and format set to false', () => {
test('Wrap with abbreviation and format set to false', () => {
return workspace.getConfiguration('emmet').update('syntaxProfiles',{ 'html' : { 'format': false } } , ConfigurationTarget.Global).then(() => {
return testWrapWithAbbreviation(multiCursors,'h1',wrapInlineElementExpectedFormatFalse).then(() => {
return workspace.getConfiguration('emmet').update('syntaxProfiles',oldValueForSyntaxProfiles ? oldValueForSyntaxProfiles.globalValue : undefined, ConfigurationTarget.Global);
});
});
});
test('Wrap multi line selections with abbreviation', () => {
const htmlContentsForWrapMultiLineTests = `
<ul class="nav main">
line1
line2
line3
line4
</ul>
`;
const wrapMultiLineExpected = `
<ul class="nav main">
<div>
line1
line2
</div>
<div>
line3
line4
</div>
</ul>
`;
return testWrapWithAbbreviation([new Selection(2, 4, 3, 9), new Selection(5, 4, 6, 9)], 'div', wrapMultiLineExpected, htmlContentsForWrapMultiLineTests);
});
});
function testWrapWithAbbreviation(selections: Selection[], abbreviation: string, expectedContents: string): Thenable<any> {
return withRandomFileEditor(htmlContentsForWrapTests, 'html', (editor, _) => {
function testWrapWithAbbreviation(selections: Selection[], abbreviation: string, expectedContents: string, input: string = htmlContentsForWrapTests): Thenable<any> {
return withRandomFileEditor(input, 'html', (editor, _) => {
editor.selections = selections;
const promise = wrapWithAbbreviation({ abbreviation });
if (!promise) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册