refactor: simplify HtmlPreview component by extracting render logic into a separate function (#6740)

* refactor: simplify HtmlPreview component by extracting render logic into a separate function

* refactor: wrap renderHtmlPreview in a fragment for improved JSX structure

* fix: update preview visibility check in response format tests
This commit is contained in:
Abhishek S Lal
2026-01-08 20:04:38 +05:30
committed by GitHub
parent 39a6fc837d
commit 7328988e59
2 changed files with 5 additions and 9 deletions

View File

@@ -43,7 +43,7 @@ test.describe.serial('Response Format Select and Preview', () => {
await switchResponseFormat(page, 'HTML');
await expect(codeLine.nth(1)).toContainText('"hello": "bruno"');
await switchToPreviewTab(page);
await expect(previewContainer).toContainText('{"hello":"bruno"}');
await expect(previewContainer.locator('webview')).toBeVisible();
});
await test.step('Switch to Editor, select XML, verify editor and preview error', async () => {
@@ -59,7 +59,7 @@ test.describe.serial('Response Format Select and Preview', () => {
await switchResponseFormat(page, 'JavaScript');
await expect(codeLine.nth(1)).toContainText('"hello": "bruno"');
await switchToPreviewTab(page);
await expect(previewContainer).toContainText('{"hello":"bruno"}');
await expect(previewContainer.locator('webview')).toBeVisible();
});
await test.step('Switch to Editor, select Raw, verify editor and preview', async () => {