Skip to content

Merge pull request #234 from contentstack/fix/DX-3664-missing-attrs

Sign in for the full log view
GitHub Actions / JEST Tests succeeded Nov 10, 2025 in 0s

322 passed, 0 failed and 0 skipped

Tests passed successfully

βœ…Β reports/junit/jest-junit.xml

322 tests were completed in 8s with 322 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
test/attributes-to-string.test.ts 11βœ… 130ms
test/default-node-options.test.ts 18βœ… 3s
test/default-options.test.ts 13βœ… 282ms
test/embedded-types.test.ts 2βœ… 32ms
test/endpoints.test.ts 50βœ… 219ms
test/entry-editable.test.ts 25βœ… 480ms
test/find-embedded-objects.test.ts 18βœ… 344ms
test/find-render-content.test.ts 28βœ… 162ms
test/gql/gql-json-to-html.test.ts 23βœ… 595ms
test/html-to-json.test.ts 4βœ… 68ms
test/json-to-html.test.ts 55βœ… 3s
test/node/mark-types.test.ts 1βœ… 47ms
test/node/node-initialise.test.ts 3βœ… 144ms
test/node/node-types.test.ts 1βœ… 68ms
test/reference-to-html.test.ts 13βœ… 264ms
test/regex-match.test.ts 4βœ… 82ms
test/render-embedded-to-html.test.ts 26βœ… 3s
test/string-extension.test.ts 10βœ… 164ms
test/text-node-to-html.test.ts 14βœ… 248ms
test/updateAssetURLForGQL.test.ts 3βœ… 91ms

βœ…Β test/attributes-to-string.test.ts

Attributes to String
  βœ… Should return blank string on blank attributes
  βœ… Should return style type string
  βœ… Should return string of attributes key value format
  βœ… Should return string format for array attribute value
  βœ… Should rignore attributes with forbidden characters in keys and values
  βœ… Should handle object attribute values correctly
  βœ… Should convert arrays into comma-separated values
  βœ… Should handle special characters in values properly
  βœ… Should handle mixed types of values properly
  βœ… Should sanitize both keys and values to prevent HTML injection
  βœ… Should ignore attributes with forbidden characters in keys

βœ…Β test/default-node-options.test.ts

Default node render options
  βœ… Should return document string
  βœ… Should return paragraph string
  βœ… Should return link string
  βœ… Should return link string with url as attr
  βœ… Should return Heading string
  βœ… Should return List string
  βœ… Should return HR string
  βœ… Should return table string
  βœ… Should return block quote string
  βœ… Should return code string
  βœ… Should return reference string
  βœ… Should return bold string
  βœ… Should return italic string
  βœ… Should return underline string
  βœ… Should return strike through string
  βœ… Should return inline code string
  βœ… Should return subscript string
  βœ… Should return superscript string

βœ…Β test/default-options.test.ts

Default Option test
  βœ… Default options Entry with only uid test
  βœ… Default options Entry with uid, url test
  βœ… Default options Entry with only uid, title test
  βœ… Default options Entry with only uid, url, title test
  βœ… Default options Entry with only uid, url, system-uid test
  βœ… Default options Asset with only uid test
  βœ… Default options Asset with uid and url test
  βœ… Default options Asset with uid and filename test
  βœ… Default options Asset with uid, url and filename test
  βœ… Default options Asset with uid and title test
  βœ… Default options Asset with uid, url and filename test
  βœ… Default options Asset with uid, url and filename test
  βœ… Default options Link text test

βœ…Β test/embedded-types.test.ts

Embedded types test
  βœ… Embedded Asset type test
  βœ… Embedded Entry type test

βœ…Β test/endpoints.test.ts

getContentstackEndpoint β€Ί Basic functionality
  βœ… should return default endpoints for valid region without service
  βœ… should return specific service endpoint for valid region and service
  βœ… should throw error for invalid service
  βœ… should throw error with exact error message format for invalid service
getContentstackEndpoint β€Ί Region alias matching
  βœ… should match region by alias "na"
  βœ… should match region by alias "aws-na"
  βœ… should match region by alias "aws_na"
  βœ… should be case insensitive for region matching
  βœ… should trim whitespace from region input
getContentstackEndpoint β€Ί omitHttps parameter
  βœ… should strip https from string endpoint when omitHttps is true
  βœ… should strip https from all endpoints when omitHttps is true and no service specified
  βœ… should preserve https when omitHttps is false
  βœ… should strip https from EU endpoint when omitHttps is true
  βœ… should strip https from Azure endpoint when omitHttps is true
  βœ… should strip https from GCP endpoint when omitHttps is true
  βœ… should strip https from all endpoints for EU region when omitHttps is true
getContentstackEndpoint β€Ί Error handling and edge cases
  βœ… should throw error for empty region
  βœ… should throw error for invalid region
  βœ… should throw error when region is not found
getContentstackEndpoint β€Ί Default parameters
  βœ… should use default region "us" when no region provided
  βœ… should use default service "" when no service provided
  βœ… should use default omitHttps false when not provided
  βœ… should return all endpoints when service is empty string
getContentstackEndpoint β€Ί Service-specific endpoints
  βœ… should return correct application endpoint
  βœ… should return correct auth endpoint
  βœ… should return correct graphqlDelivery endpoint
  βœ… should return correct preview endpoint
  βœ… should return correct images endpoint
  βœ… should return correct assets endpoint
  βœ… should return correct automate endpoint
  βœ… should return correct launch endpoint
  βœ… should return correct developerHub endpoint
  βœ… should return correct brandKit endpoint
  βœ… should return correct genAI endpoint
  βœ… should return correct personalizeManagement endpoint
  βœ… should return correct personalizeEdge endpoint
getContentstackEndpoint β€Ί Additional regions and aliases
  βœ… should return correct EU endpoints
  βœ… should return correct Australia endpoints
  βœ… should match Australia region by alias "aws-au"
  βœ… should return correct Azure NA endpoints
  βœ… should return correct Azure EU endpoints
  βœ… should return correct GCP NA endpoints
  βœ… should return correct GCP EU endpoints
  βœ… should match Azure region by underscore alias
  βœ… should match GCP region by underscore alias
getContentstackEndpoint β€Ί Edge cases and error scenarios
  βœ… should throw error for null region
  βœ… should use default region for undefined region
  βœ… should handle region with only whitespace
  βœ… should throw error for region with special characters
  βœ… should throw error for very long region name

βœ…Β test/entry-editable.test.ts

Entry editable test
  βœ… Entry with text test
  βœ… Entry with text should return object test
  βœ… Entry with Modular blocks test
  βœ… Entry with Modular blocks test return object
  βœ… Entry with reference test
  βœ… Entry with reference should return object test
  βœ… Entry with global fields test
  βœ… Entry with reference should return object test
  βœ… Entry with reference test
  βœ… Entry with reference should return object test
Entry editable test β€Ί Applied Variants Tests
  βœ… Entry with applied variants should generate v2 tags with variant suffix
  βœ… Entry with applied variants should return v2 objects when tagsAsObject is true
  βœ… Entry with parent path variants should find correct variant
  βœ… Entry with modular block variants should apply variants correctly
  βœ… Entry without applied variants should work normally
  βœ… Entry with empty applied variants should work normally
  βœ… Entry with array containing null values should skip null elements
  βœ… Entry with array containing undefined values should skip undefined elements
  βœ… Entry with array containing mixed null and undefined values should skip both
  βœ… Entry with _embedded_items containing null values should handle gracefully
  βœ… Entry with nested arrays containing nulls in complex structure should work
  βœ… Variant path sorting should work correctly for nested paths
  βœ… Reference fields should not inherit parent variants when they have no applied_variants
  βœ… Reference fields with their own applied_variants should use their variants
  βœ… Reference fields should work correctly with tagsAsObject=true

βœ…Β test/find-embedded-objects.test.ts

Embedded object render from content
  βœ… Find Embedded Entry no matching uids with blank embedded Entry test
  βœ… Find Embedded Entry no matching uids with embedded Entry test
  βœ… Find Embedded Entry no matching uids without embedded Entry test
  βœ… Find Embedded Asset matching uids with embedded asset test
  βœ… Find Embedded asset and entry matching contents test
  βœ… Find EmbedObject from undefinded data test
  βœ… Find EmbedObject from embed asset test
  βœ… Find Render string from undefined objects test
  βœ… Find Render string from default renderOption
  βœ… Find Render string from default renderOption with alternate text
  βœ… Find Render string from passed renderOption
findEmbeddedEntry edge cases
  βœ… should return empty array if embeddeditems contains null or undefined
  βœ… should skip falsy entries in embeddeditems
findEmbeddedAsset edge cases
  βœ… should return empty array if embeddedAssets contains null or undefined
  βœ… should skip falsy assets in embeddedAssets
findGQLEmbeddedItems edge cases
  βœ… should return empty array if metadata is null
  βœ… should return empty array if items is null
  βœ… should return empty array if both metadata and items are null

βœ…Β test/find-render-content.test.ts

Find Render content test
  βœ… test getContent function
  βœ… blank path path test
  βœ… Simple String path test
  βœ… Array String path test
  βœ… Global Field String path test
  βœ… Global Field Array String path test
  βœ… Global Field Group String path test
  βœ… Global Field Group Array String path test
  βœ… Global Field modular block String path test
  βœ… Global Field modular block Array String path test
  βœ… Multiple Global Field String path test
  βœ… Multiple Global Field Array String path test
  βœ… Multiple Global Field Group String path test
  βœ… Multiple Global Field Group Array String path test
  βœ… Multiple Global Field modular block String path test
  βœ… Multiple Global Field modular block Array String path test
  βœ… Group String path test
  βœ… Group Array String path test
  βœ… modular blocks String path test
  βœ… modular blocks Array String path test
  βœ… Modular RTE Block String path test
  βœ… Modular RTE Block Array String path test
  βœ… Modular Global field Block String path test
  βœ… Modular Global field Block Array String path test
  βœ… Modular Global field Block group String path test
  βœ… Modular Global field Block group Array String path test
  βœ… Modular Global field Block Modular String path test
  βœ… Modular Global field Block Modular Array String path test

βœ…Β test/gql/gql-json-to-html.test.ts

GQL Json To HTML
  βœ… Should accept proper values
  βœ… Should return content for non JSON RTE
  βœ… Should render Json To html
  βœ… Should render Json To html for Array of Entries
Node parser reference content
  βœ… Should render reference asset to html from Entry
  βœ… Should render reference asset to html from Entries
  βœ… Should render reference entry Block to html from Entries
  βœ… Should render reference entry link to html from Entries
  βœ… Should render reference entry inline to html from Entries
GQL parse text Content
  βœ… Should return all text wrapped patterns
GQL parse headers content
  βœ… Should return h1 html string
  βœ… Should return h2 html string
  βœ… Should return h3 html string
  βœ… Should return h4 html string
  βœ… Should return h5 html string
  βœ… Should return h6 html string
Node parse list content
  βœ… Should return order list html content
  βœ… Should return un-order list html content
GQL parse image content
  βœ… Should return image html content
GQL parse table content
  βœ… Should return table html content
Node parse blockquote content
  βœ… Should return blockquote html content
GQL parse code content
  βœ… Should return code html content
GQL parse link in paragraph content
  βœ… Should return link in paragraph html content

βœ…Β test/html-to-json.test.ts

HTML To JSON test
  βœ… HTML To JSON figure tag with no child test
  βœ… HTML to JSON entry figure tag test
  βœ… HTML to JSON asset figure tag test
  βœ… HTML to JSON false tag test

βœ…Β test/json-to-html.test.ts

Node parser paragraph content
  βœ… Should accept proper values
  βœ… Should return content for non JSON RTE
  βœ… Should render Json To html
  βœ… Should render Json To html with newline after single enter
  βœ… Should render Json To html for Array of Entries
  βœ… Should render array Json To array html
  βœ… Should render array Json To array html for array of Entries
  βœ… Should render Json To html
  βœ… Should escape HTML tags in text content to prevent rendering as HTML
  βœ… Should escape HTML tags in text with actual bold formatting
  βœ… Should escape dangerous script tags in text content
  βœ… Should escape HTML entities like ampersand and quotes in text
Node parser reference content
  βœ… Should render reference asset to html from Entry
  βœ… Should render reference asset to html from Entries
  βœ… Should render reference asset to html from Entry with custom render option
  βœ… Should render reference asset to html from Entries with custom render option
  βœ… should convert to html when and type is reference, attrs type is entry and display-type is link
  βœ… should convert to html when asset embedded as link in json_rte
Node parse text Content
  βœ… Should return all text wrapped patterns
  βœ… Should return array text wrapped patterns
  βœ… Should return html text with classname
  βœ… Should return html text with id
Node parse headers content
  βœ… Should return h1 html string
  βœ… Should return h2 html string
  βœ… Should return h3 html string
  βœ… Should return h4 html string
  βœ… Should return h5 html string
  βœ… Should return h6 html string
  βœ… Shoul return array of headers in html string
Node parse list content
  βœ… Should return order list html content
  βœ… Should return order list html content for updated json rte
  βœ… Should return un-order list html content
  βœ… Should return unorder list html content for previous json rte
  βœ… Should return unorder list html content for updated json rte
Node parse image content
  βœ… Should return image html content
  βœ… Should return image list html content
Node parse table content
  βœ… Should return table html content
Node parse blockquote content
  βœ… Should return blockquote html content
  βœ… Should return blockquote array html content
Node parse code content
  βœ… Should return code html content
  βœ… Should return code array html content
Node parse link in paragraph content
  βœ… Should return link in paragraph html content
  βœ… Should return link in paragraph array html content
Node parse style attribute
  βœ… Should return style attribute in paragraph html content
  βœ… Should return style attribute in headings tag content
Node parse json_rte Content
  βœ… Should return html text with classname
  βœ… Should return html text with id
  βœ… Should return html text with id in parent tag
  βœ… Should return html text with class and id in parent tag
  βœ… Testing json to html with figure tag
Break and Newline handling tests
  βœ… Should handle break flag in text nodes correctly
  βœ… Should handle newline with break flag without duplication
  βœ… Should handle multiple newlines with break flag correctly
  βœ… Should handle plain newlines without break flag
  βœ… Should handle break flag in arrays

βœ…Β test/node/mark-types.test.ts

Node Type Test
  βœ… Check Node Type Values

βœ…Β test/node/node-initialise.test.ts

Node parser
  βœ… Should return node object
  βœ… Should return Document object
  βœ… Should return Document object

βœ…Β test/node/node-types.test.ts

Node Type Test
  βœ… Check Node Type Values

βœ…Β test/reference-to-html.test.ts

Reference Node To HTML
  βœ… Should return blank for undefined entry
  βœ… Should return blank for no children
  βœ… Should return HTML for embedded asset
  βœ… Should return HTML for embedded block entry
  βœ… Should return HTML for embedded link entry
  βœ… Should return HTML for embedded inline entry
  βœ… Should return custom HTML for embedded asset
  βœ… Should return custom HTML for embedded block entry
  βœ… Should return custom HTML for embedded inline entry
  βœ… Should return custom default HTML for embedded inline entry
  βœ… Should return image for undefined node asset
  βœ… Should return image for undefined node asset from default node option
  βœ… Should return HTML for embedded link entry

βœ…Β test/regex-match.test.ts

Regex Match Test
  βœ… Check string contains Figure Tag test
  βœ… Match Asset and Entry figure
  βœ… Match Count Asset and Entry figure
  βœ… Match Figure Tag test

βœ…Β test/render-embedded-to-html.test.ts

Embedded object render from content
  βœ… Render Simple Entry without renderOption
  βœ… Render Simple Entry with renderOption
  βœ… Render Simple Entry with $default in renderOption
  βœ… Render Simple Entry without renderOption and paths
  βœ… Render Simple Entry with renderOption without path
  βœ… Render Simple Entries without renderOption
  βœ… Render Simple Entries with renderOption
  βœ… Render Simple Entries without renderOption and path
  βœ… Render Simple Entries with renderOption without path
  βœ… Render function with blank content and options test
  βœ… Render function with non html content
  βœ… Render function with html content without Embedded object
  βœ… Render function with non html content and blanks
  βœ… Render Function with Embedded Entry without Options
  βœ… Render Function with Embedded Asset without Options test
  βœ… Render Function with Embedded Entry with Options
  βœ… Render Function with Embedded Entry with no items Options
  βœ… Render Function with Embedded Asset with Options test
  βœ… Render Function string of array with Embedded Entry with Options
  βœ… Render Function to render Embbedded Asset test
  βœ… Render Function to render Embbedded Asset with render option test
  βœ… Render Function to render Embedded Entries with out render option test
  βœ… Render Function to render Embedded Entries with render option test
  βœ… Render Function to render Embedded Entries with render option test
  βœ… Render function to render Embedded Entries with Multi-level rendering test
  βœ… Render function to render Embedded Entries with Multi-level rendering test

βœ…Β test/string-extension.test.ts

String extension for each embedded Object 
  βœ… Find Embedded object function with undefined string test
  βœ… Find Embedded object function with no Embedded contents test
  βœ… Find Embedded object function with Embedded contents no child test
  βœ… Find Embedded entry function with Embedded contents test
  βœ… Find Embedded assets function with Embedded contents test
  βœ… Find Embedded multiple object Link and Inline test
  βœ… Find Embedded multiple object Block, Link and Inline test
  βœ… Find Embedded multiple object Link and Display test
  βœ… Find Embedded multiple object Display, Link and Inline test
  βœ… Find Embedded multiple object Display, Block, Link and Inline test

βœ…Β test/text-node-to-html.test.ts

Text Node To HTML
  βœ… Should return Bold string text
  βœ… Should return Italic string text
  βœ… Should return Underline string text
  βœ… Should return Strike Through string text
  βœ… Should return Inline Code string text
  βœ… Should return Subscript string text
  βœ… Should return Bold string text
  βœ… Should return combine Marks string text
  βœ… Should return Break string text
  βœ… Should handle newline character without break flag
  βœ… Should handle single newline with break flag without duplication
  βœ… Should handle multiple newlines with break flag without duplication
  βœ… Should handle text with newline and break flag properly
  βœ… Should handle break with other marks

βœ…Β test/updateAssetURLForGQL.test.ts

updateAssetURLForGQL test
  βœ… should update the asset URL in the GQL response when proper response is passed
  βœ… should update the asset URL in the GQL response with multiple entries when proper response is passed
  βœ… should throw error when system.uid is not present