chore(vscode): update to 1.53.2
These conflicts will be resolved in the following commits. We do it this way so that PR review is possible.
This commit is contained in:
52
lib/vscode/src/vs/base/test/browser/iconLabels.test.ts
Normal file
52
lib/vscode/src/vs/base/test/browser/iconLabels.test.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';
|
||||
import * as assert from 'assert';
|
||||
|
||||
suite('renderLabelWithIcons', () => {
|
||||
|
||||
test('no icons', () => {
|
||||
const result = renderLabelWithIcons(' hello World .');
|
||||
|
||||
assert.equal(elementsToString(result), ' hello World .');
|
||||
});
|
||||
|
||||
test('icons only', () => {
|
||||
const result = renderLabelWithIcons('$(alert)');
|
||||
|
||||
assert.equal(elementsToString(result), '<span class="codicon codicon-alert"></span>');
|
||||
});
|
||||
|
||||
test('icon and non-icon strings', () => {
|
||||
const result = renderLabelWithIcons(` $(alert) Unresponsive`);
|
||||
|
||||
assert.equal(elementsToString(result), ' <span class="codicon codicon-alert"></span> Unresponsive');
|
||||
});
|
||||
|
||||
test('multiple icons', () => {
|
||||
const result = renderLabelWithIcons('$(check)$(error)');
|
||||
|
||||
assert.equal(elementsToString(result), '<span class="codicon codicon-check"></span><span class="codicon codicon-error"></span>');
|
||||
});
|
||||
|
||||
test('escaped icons', () => {
|
||||
const result = renderLabelWithIcons('\\$(escaped)');
|
||||
|
||||
assert.equal(elementsToString(result), '$(escaped)');
|
||||
});
|
||||
|
||||
test('icon with animation', () => {
|
||||
const result = renderLabelWithIcons('$(zip~anim)');
|
||||
|
||||
assert.equal(elementsToString(result), '<span class="codicon codicon-zip codicon-modifier-anim"></span>');
|
||||
});
|
||||
|
||||
const elementsToString = (elements: Array<HTMLElement | string>): string => {
|
||||
return elements
|
||||
.map(elem => elem instanceof HTMLElement ? elem.outerHTML : elem)
|
||||
.reduce((a, b) => a + b, '');
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user