NYPL-Simplified / webpub-viewer

8 stars 4 forks source link

Allow custom library icons to be displayed in nav #166

Closed M0nica closed 3 years ago

M0nica commented 3 years ago

Currently, the NYPL Logo is hard-coded within the uplink (nav) portion of the webpub-viewer. The uplink already has customizable url, label, and ariaLabel.

This PR updates the webpub-viewer to allow passing in a custom logo (i.e., Open E-Books logo) URL to display in nav. The default icon will be the NYPL icon so this should not be a broken change.

M0nica commented 3 years ago

Is there a unit test that makes sense here?

I added a couple of unit tests:

I am not sure if there's a better way to check whether or not an svg is rendered, right now I am using the presence/absence of "aria-labelled-by" since the svg icon uses that attribute but the image attributes use the "title" attribute directly. If you have suggestions for a better selector I can update the tests!