Skip to content

fix: types path in package.json - #237

Merged
nadeem-cs merged 1 commit into
stagingfrom
fix/types-path
Nov 12, 2025
Merged

nadeem-cs merged 1 commit into
stagingfrom
fix/types-path

fix: types path in package.json

ce0d35d
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
This check has been archived and is scheduled for deletion. Learn more about checks retention
GitHub Actions / JEST Tests succeeded Nov 12, 2025 in 0s

352 passed, 0 failed and 0 skipped

Tests passed successfully

✅ reports/junit/jest-junit.xml

352 tests were completed in 6s with 352 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
test/attributes-to-string.test.ts 11✅ 89ms
test/default-node-options.test.ts 48✅ 551ms
test/default-options.test.ts 13✅ 120ms
test/embedded-types.test.ts 2✅ 57ms
test/endpoints.test.ts 50✅ 154ms
test/entry-editable.test.ts 25✅ 482ms
test/find-embedded-objects.test.ts 18✅ 138ms
test/find-render-content.test.ts 28✅ 150ms
test/gql/gql-json-to-html.test.ts 23✅ 193ms
test/html-to-json.test.ts 4✅ 88ms
test/json-to-html.test.ts 55✅ 595ms
test/node/mark-types.test.ts 1✅ 51ms
test/node/node-initialise.test.ts 3✅ 119ms
test/node/node-types.test.ts 1✅ 65ms
test/reference-to-html.test.ts 13✅ 228ms
test/regex-match.test.ts 4✅ 91ms
test/render-embedded-to-html.test.ts 26✅ 387ms
test/string-extension.test.ts 10✅ 188ms
test/text-node-to-html.test.ts 14✅ 159ms
test/updateAssetURLForGQL.test.ts 3✅ 83ms

✅ 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
Default node render options - Missing attrs cases
  ✅ Should handle paragraph without attrs
  ✅ Should handle paragraph with undefined attrs
  ✅ Should handle link without attrs
  ✅ Should handle link without href or url
  ✅ Should handle image without attrs
  ✅ Should handle image without src or url
  ✅ Should handle embed without attrs
  ✅ Should handle headings without attrs
  ✅ Should handle headings with partial attrs
  ✅ Should handle lists without attrs
  ✅ Should handle table without attrs
  ✅ Should handle table without colWidths
  ✅ Should handle table head without attrs
  ✅ Should handle table head without rowSpan or colSpan
  ✅ Should handle table data without attrs
  ✅ Should handle table data with void attribute
  ✅ Should handle blockquote without attrs
  ✅ Should handle code without attrs
  ✅ Should handle reference without attrs
  ✅ Should handle reference with type but no display-type
  ✅ Should handle reference with entry type and link display-type but missing href
  ✅ Should handle reference with asset type and link display-type but missing href
  ✅ Should handle reference with asset type but missing asset-link
  ✅ Should handle reference with asset type but partial attributes
  ✅ Should handle link with target attribute
  ✅ Should handle link without target attribute
  ✅ Should handle elements with only class-name attribute
  ✅ Should handle elements with only id attribute
  ✅ Should handle elements with only style attribute
  ✅ Should handle all common attributes together

✅ 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