Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing: fix markdown messages not displaying #224612

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/vs/workbench/contrib/testing/browser/media/testing.css
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@

.test-output-peek-message-container .preview-text {
padding: 8px 12px 8px 20px;
height: calc(100% - 16px);
line-height: normal;
white-space: normal;
}

.test-output-peek-message-container .preview-text p:first-child {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class DiffContentProvider extends Disposable implements IPeekOutputRender
}

editor.layout(dimensions);
const height = Math.min(1000, Math.max(editor.getOriginalEditor().getContentHeight(), editor.getModifiedEditor().getContentHeight()));
const height = Math.min(10000, Math.max(editor.getOriginalEditor().getContentHeight(), editor.getModifiedEditor().getContentHeight()));
editor.layout({ height, width: dimensions.width });
return height;
}
Expand Down Expand Up @@ -219,7 +219,6 @@ export class MarkdownTestMessagePeek extends Disposable implements IPeekOutputRe


const rendered = this._register(this.markdown.value.render(message.message, {}));
rendered.element.style.height = '100%';
rendered.element.style.userSelect = 'text';
rendered.element.classList.add('preview-text');
this.container.appendChild(rendered.element);
Expand All @@ -232,7 +231,7 @@ export class MarkdownTestMessagePeek extends Disposable implements IPeekOutputRe
return undefined;
}

this.element.style.width = `${dimension.width}px`;
this.element.style.width = `${dimension.width - 32}px`;
return this.element.clientHeight;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class MessageStackFrame extends CustomStackFrame {
}

public override render(container: HTMLElement): IDisposable {
this.message.style.visibility = 'visible';
container.appendChild(this.message);
return toDisposable(() => this.message.remove());
}
Expand Down Expand Up @@ -320,7 +321,13 @@ export class TestResultsViewContent extends Disposable {
}

private async prepareTopFrame(subject: InspectSubject, callFrames: ITestMessageStackFrame[]) {
// ensure the messageContainer is in the DOM so renderers can calculate the
// dimensions before it's rendered in the list.
this.messageContainer.style.visibility = 'hidden';
this.stackContainer.appendChild(this.messageContainer);

const topFrame = this.currentTopFrame = this.instantiationService.createInstance(MessageStackFrame, this.messageContainer, this.followupWidget, subject);

topFrame.showHeader.set(callFrames.length > 0, undefined);

const provider = await findAsync(this.contentProviders, p => p.update(subject));
Expand Down
Loading