Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rich text editor | Need an update to the testing strategy followed in markdown-serializer #1533

Closed
Tracked by #1288
vivinkrishna-ni opened this issue Sep 14, 2023 · 3 comments

Comments

@vivinkrishna-ni
Copy link
Contributor

vivinkrishna-ni commented Sep 14, 2023

🧹 Tech Debt

Relevant discussions:

#1496 (comment)
#1526 (comment)

In the rich text editor component, the custom-written markdown serializer's unit tests need an update in the testing strategy. Currently, it creates a mock TipTap editor with configurations not aligned with the actual editor and is unstable moving forward. We need to find a better approach so that the test written is aligned with the production code and also avoid writing manual HTML inputs as same as the Tiptap editor renders.

@jattasNI
Copy link
Contributor

@aagash-ni could you update the description of this issue or leave a comment describing what work is remaining to close the issue now that #1633 is complete?

@vivinkrishna-ni
Copy link
Contributor Author

@jattasNI This issue is resolved with this #1633 PR completion. The Chromatic tests that I mentioned earlier are already taken into consideration for absolute links in viewer and editor matrix tests and also for other rich text formatting.

This issue is primarily to resolve this comment on the markdown-serializer testing strategy and not includes the integration testing like copy-pasting from other rich text component. For integration testing, we have a separate issue created #1568 and will be tracking from there. We would like to get your thoughts/acknowledgment to close this issue.

@jattasNI
Copy link
Contributor

@vivinkrishna-ni Sounds good, I'll close this.

@jattasNI jattasNI moved this from Backlog to Done in Nimble Design System Priorities Nov 20, 2023
mollykreis pushed a commit that referenced this issue Nov 27, 2023
)

# Pull Request

## 🤨 Rationale
Testing strategy in the markdown serializer need to be updated as it is
generating a mock editor currently to test the behavior instead of
implementing actual editor. So, it needs to be updated with actual
editor to test the production configuration.

Issue link: #1533 

## 👩‍💻 Implementation

- Removed the mock editor and constructed the actual editor
`nimble-rich-text-editor` to get the editor document.
- Removed all the html as input and updated it with `setMarkdown()`
method as in production flow only there will be markdown interaction
with the editor and not with the html.

## 🧪 Testing

- Manually ran the test and verified.

## ✅ Checklist

<!--- Review the list and put an x in the boxes that apply or ~~strike
through~~ around items that don't (along with an explanation). -->

- [x] I have updated the project documentation to reflect my changes or
determined no changes are needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants