Skip to content
New issue

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

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

Already on GitHub? # to your account

RelationCard placeholder Image #70

Open
DomVinyard opened this issue Mar 6, 2023 · 1 comment
Open

RelationCard placeholder Image #70

DomVinyard opened this issue Mar 6, 2023 · 1 comment
Assignees

Comments

@DomVinyard
Copy link
Collaborator

DomVinyard commented Mar 6, 2023

User Story:

As a user, I want to see a placeholder image in the RelationCard component when no image is provided. Currently it just shows the alt text

Image

Acceptance Criteria:

  • The RelationCard component should display a placeholder image when no image is provided for a given relationship.
  • The placeholder image should be be consistent with the TopicCard placeholder image
  • The placeholder image should not interfere with any other functionality or information in the component.
  • The implementation should be tested and validated to ensure that it works as expected.
  • The implementation should be documented and easily understandable for future developers.
  • The implementation should be reviewed and approved by the development team and stakeholders.
@DomVinyard DomVinyard changed the title RelationCard fallback to placeholder Image RelationCard placeholder Image Mar 6, 2023
@Ademsk1 Ademsk1 self-assigned this Mar 8, 2023
@swdilip swdilip self-assigned this Mar 8, 2023
@swdilip
Copy link
Collaborator

swdilip commented Mar 8, 2023

Documentation

When no image is provided for RelationCard or TopicCard

An onError function is triggered which then fires a callBack function called replaceImage which replaces the src of that image element with a placeholder image.

Tests

The TopicCard and RelationCard components are rendered within the test, img element is selected using getByRole and then the error is fired using fireEvent.error which then fires the callBack function which replaces the src with the placeholder whose value can now be tested.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants