💄 Emmet tests

This commit is contained in:
Raymond Zhao
2021-03-30 11:27:51 -07:00
parent 9503e7dce7
commit 9b091c7d22
15 changed files with 173 additions and 177 deletions

View File

@@ -12,10 +12,7 @@ import { closeAllEditors, withRandomFileEditor } from './testUtils';
const completionProvider = new DefaultCompletionItemProvider();
suite('Tests for completion in CSS embedded in HTML', () => {
teardown(() => {
// close all editors
return closeAllEditors();
});
teardown(closeAllEditors);
test('style attribute & attribute value in html', async () => {
await testHtmlCompletionProvider('<div style="|"', [{ label: 'padding: ;' }]);
@@ -81,10 +78,10 @@ function testHtmlCompletionProvider(contents: string, expectedItems: TestComplet
assert.ok(match, `Didn't find completion item with label ${eItem.label}`);
if (match) {
assert.equal(match.detail, 'Emmet Abbreviation', `Match needs to come from Emmet`);
assert.strictEqual(match.detail, 'Emmet Abbreviation', `Match needs to come from Emmet`);
if (eItem.documentation) {
assert.equal(match.documentation, eItem.documentation, `Emmet completion Documentation doesn't match`);
assert.strictEqual(match.documentation, eItem.documentation, `Emmet completion Documentation doesn't match`);
}
}
});
@@ -122,10 +119,10 @@ function testCssCompletionProvider(contents: string, expectedItems: TestCompleti
assert.ok(match, `Didn't find completion item with label ${eItem.label}`);
if (match) {
assert.equal(match.detail, 'Emmet Abbreviation', `Match needs to come from Emmet`);
assert.strictEqual(match.detail, 'Emmet Abbreviation', `Match needs to come from Emmet`);
if (eItem.documentation) {
assert.equal(match.documentation, eItem.documentation, `Emmet completion Documentation doesn't match`);
assert.strictEqual(match.documentation, eItem.documentation, `Emmet completion Documentation doesn't match`);
}
}
});