• + 0 comments

    Hello everyone,

    to fix the problem with the testing feedback you need to modify 4 parts of the code so the test can pass.

    The issue is that the initial code has data-testid attributes that are fixed to 0. This prevents the testing mechanism from working properly because the tests rely on unique identifiers for each element. To resolve this, you need to change the fixed 0 to a dynamic value (like using index), ensuring each element has a unique data-testid.

    1 - first change the (data-testid) in the upvote and downvote buttons:

    • upvote button -> data-testid={upvote-btn-${index}}
    • downvote button -> data-testid={downvote-btn-${index}}

    2- Finally, change the (data-testid) in the p tags that shows the upvote and downvote count inside of them like this:

    • upvote count -> data-testid={upvote-count-${index}}
    • downvote count -> data-testid={downvote-count-${index}}

    you need to be mapping through an array of the feedback aspects for this to work.

    this will hopefully solve the problem with the testing, if anything else occurs, check your code again.