mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-08 22:45:25 +00:00
fix(bru-1447): json response formatting using fast-json-format library (#5932)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
meta {
|
||||
name: bigint-request
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: https://echo.usebruno.com
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"data": 1736184243098437392
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"version": "1",
|
||||
"name": "bigint-test",
|
||||
"type": "collection",
|
||||
"ignore": [
|
||||
"node_modules",
|
||||
".git"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"collections": [
|
||||
{
|
||||
"path": "{{projectRoot}}/tests/response/json-with-bigint-response-formatting/fixtures/collection",
|
||||
"securityConfig": {
|
||||
"jsSandboxMode": "safe"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"maximized": false,
|
||||
"lastOpenedCollections": [
|
||||
"{{projectRoot}}/tests/response/json-with-bigint-response-formatting/fixtures/collection"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import { test, expect } from '../../../playwright';
|
||||
import { closeAllCollections } from '../../utils/page';
|
||||
|
||||
test.describe.serial('JSON Response Formatting with BigInt', () => {
|
||||
test.afterAll(async ({ pageWithUserData: page }) => {
|
||||
// cleanup: close all collections
|
||||
await closeAllCollections(page);
|
||||
});
|
||||
|
||||
test('should handle BigInt values in JSON response formatting', async ({ pageWithUserData: page }) => {
|
||||
await test.step('Navigate to collection and request', async () => {
|
||||
// Navigate to the test collection
|
||||
await expect(page.locator('#sidebar-collection-name').getByText('bigint-test')).toBeVisible();
|
||||
await page.locator('#sidebar-collection-name').getByText('bigint-test').click();
|
||||
|
||||
// Navigate to the bigint request
|
||||
await page.getByRole('complementary').getByText('bigint-request').click();
|
||||
});
|
||||
|
||||
await test.step('Send request and verify response', async () => {
|
||||
// Send the request
|
||||
await page.getByTestId('send-arrow-icon').click();
|
||||
|
||||
// Wait for response
|
||||
await expect(page.getByTestId('response-status-code')).toContainText('200', { timeout: 15000 });
|
||||
|
||||
// Verify the response is properly formatted JSON
|
||||
const responseBody = page.locator('.response-pane');
|
||||
await expect(responseBody).toBeVisible();
|
||||
|
||||
// The response should echo back our request data
|
||||
await expect(responseBody).toContainText('"data": 1736184243098437392');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user