coreui / coreui-free-react-admin-template

Open source admin template based on Bootstrap 5 and React.js
https://coreui.io/product/free-react-admin-template/
MIT License
4.54k stars 2.26k forks source link

Fix(sidebar): remove items attribute from li element #404

Closed annechko closed 1 year ago

annechko commented 1 year ago

Hello!

Just found this little issue, it is happening right now in your demo: https://coreui.io/demos/react/4.0/free/#/dashboard

In sidebar navigation, all li elements with nested lists look like this (they have extraitems attribute)

<li class="nav-group show" items="[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"><a class="nav-link nav-group-toggle">

I wrote a test for this case, it doesn't pass in the current master branch but passes with the fix. I need to test for attributes that are not visible to user, that's why I did as it said here: https://testing-library.com/docs/queries/about/#manual-queries

But I was forced to ignore some linter warnings in the test file because it was complaining

  30:24  error  Avoid using container methods. Prefer using the methods from Testing Library, such as "getByRole()"  testing-library/no-container
  30:34  error  Avoid direct Node access. Prefer using the methods from Testing Library                              testing-library/no-node-access
  30:34  error  Avoid direct Node access. Prefer using the methods from Testing Library                              testing-library/no-node-access

Not the best decision, sorry, but I really wanted to add some tests! What do you think? What can I do - rewrite the test, delete the test, delete the whole MR?...

github-actions[bot] commented 1 year ago

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions