kontent-ai / delivery-sdk-js

Kontent Delivery SDK for Javascript
https://kontent.ai
MIT License
50 stars 34 forks source link

Feature/rich text linked item order #356

Closed benmorana closed 2 years ago

benmorana commented 2 years ago

Motivation

This PR aims to ensure that the order of the rich-text linkedItems and linkedItemsCodenames arrays match the order in which the items/components appear in the rich-text value property.

See this issue for more details: https://github.com/kontent-ai/delivery-sdk-js/issues/355

Checklist

How to test

Added unit tests to make sure the order of the modular_content items is fixed in the Rich Text linkedItems and linkedItemsCodenames properties of the resolved items. Testing it with live data can be a bit hit and miss as the Kontent Delivery JS API sometimes matches the order of the items in the rich text and sometimes doesn't. @Enngage Let me know if those tests should be added somewhere else in the repo 😄