Skip to content

Commit b6a5cd0

Browse files
justschenCopilot
andcommitted
test: provide fixture layout container
Expose the component fixture document body as the workbench layout service's main container so responsive phone-layout checks exercise the same contract as production. (Commit message generated by Copilot) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a8a37c0 commit b6a5cd0

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/vs/workbench/test/browser/componentFixtures/chat/chatFixtureUtils.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,13 @@ export function registerChatFixtureServices(reg: ServiceRegistration, options: I
167167
// `getContainer` stands in for the workbench container that widgets use to host
168168
// overflow nodes (suggest widget, post-paste selector); the fixture document body
169169
// is the closest equivalent.
170-
reg.defineInstance(IWorkbenchLayoutService, new class extends mock<IWorkbenchLayoutService>() { override onDidChangePartVisibility = Event.None; override onDidChangeWindowMaximized = Event.None; override isVisible() { return true; } override getContainer(targetWindow: Window): HTMLElement { return targetWindow.document.body; } }());
170+
reg.defineInstance(IWorkbenchLayoutService, new class extends mock<IWorkbenchLayoutService>() {
171+
override readonly mainContainer = document.body;
172+
override onDidChangePartVisibility = Event.None;
173+
override onDidChangeWindowMaximized = Event.None;
174+
override isVisible() { return true; }
175+
override getContainer(targetWindow: Window): HTMLElement { return targetWindow.document.body; }
176+
}());
171177
reg.defineInstance(IHostService, new class extends mock<IHostService>() {
172178
override readonly hasFocus = true;
173179
override readonly onDidChangeFocus = Event.None;

0 commit comments

Comments
 (0)