mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
tackle a todo, implement vscode.TabGroups with the ExtHostTabGroups/apiObject trick, enforce and test readonly-ness, fyi @lramos15
This commit is contained in:
@@ -317,4 +317,30 @@ suite('ExtHostEditorTabs', function () {
|
||||
assert.strictEqual(activeTab2?.isActive, true);
|
||||
assert.strictEqual(activeTab1?.isActive, false);
|
||||
});
|
||||
|
||||
test('vscode.window.tagGroups is immutable', function () {
|
||||
|
||||
const extHostEditorTabs = new ExtHostEditorTabs(
|
||||
SingleProxyRPCProtocol(new class extends mock<MainThreadEditorTabsShape>() {
|
||||
// override/implement $moveTab or $closeTab
|
||||
})
|
||||
);
|
||||
|
||||
assert.throws(() => {
|
||||
// @ts-expect-error write to readonly prop
|
||||
extHostEditorTabs.tabGroups.activeTabGroup = undefined;
|
||||
});
|
||||
assert.throws(() => {
|
||||
// @ts-expect-error write to readonly prop
|
||||
extHostEditorTabs.tabGroups.groups.length = 0;
|
||||
});
|
||||
assert.throws(() => {
|
||||
// @ts-expect-error write to readonly prop
|
||||
extHostEditorTabs.tabGroups.onDidChangeActiveTabGroup = undefined;
|
||||
});
|
||||
assert.throws(() => {
|
||||
// @ts-expect-error write to readonly prop
|
||||
extHostEditorTabs.tabGroups.onDidChangeTabGroup = undefined;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user