Skip to content

Commit

Permalink
fix: artist cover image meta (#13552)
Browse files Browse the repository at this point in the history
* fix: artist cover image meta

* fix: tests

* fix: tests
  • Loading branch information
gkartalis authored Feb 29, 2024
1 parent 2165b40 commit 35d1baa
Show file tree
Hide file tree
Showing 9 changed files with 325 additions and 418 deletions.
14 changes: 7 additions & 7 deletions src/Apps/Artist/Components/ArtistMeta/ArtistMeta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ interface Props {
}

export const ArtistMeta: React.FC<Props> = ({ artist }) => {
const alternateNames = artist?.alternate_names || []
const alternateNames = artist?.alternateNames || []

return (
<>
<MetaTags
title={artist.meta.title}
description={artist.meta.description}
imageURL={artist.image?.large}
imageURL={artist.coverArtwork?.image?.large}
pathname={artist.href}
/>

Expand Down Expand Up @@ -66,11 +66,11 @@ export const ArtistMetaFragmentContainer = createFragmentContainer(ArtistMeta, {
description
title
}
alternate_names: alternateNames
image {
versions
large: url(version: "large")
square: url(version: "square")
alternateNames
coverArtwork {
image {
large: url(version: "large")
}
}
counts {
artworks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ describe("AdminMeta", () => {

describe("alternate names", () => {
it("skips rendering them without the data", () => {
const artist = { alternate_names: [] }
const artist = { alternateNames: [] }
renderWithRelay({ Artist: () => artist })
expect(getMetaBy({ name: "skos:prefLabel" })).toBeNull()
})

it("renders them with the data", () => {
const artist = { alternate_names: ["Bonnie", "Betty"] }
const artist = { alternateNames: ["Bonnie", "Betty"] }
renderWithRelay({ Artist: () => artist })
expect(
getMetaBy({ name: "skos:prefLabel", content: "Bonnie; Betty" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ describe("Meta", () => {
description:
"Discover and purchase Claes Oldenburg’s artworks, available for sale. Browse our selection of paintings, prints, and sculptures by the artist, and find art you love.",
gender: "male",
image:
"https://d32dm0rphc51dk.cloudfront.net/6q6LeyKvA_vpT5YzHRSNUA/large.jpg",
mainEntityOfPage: "https://www.artsy-test.net/artist/claes-oldenburg",
makesOffer: [
{
Expand Down
2 changes: 1 addition & 1 deletion src/Apps/Artist/Components/ArtistMeta/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export const structuredDataAttributes = (artist: ArtistMeta_artist$data) => {
deathDate: artist.deathday,
description: artist.meta ? artist.meta.description : "",
gender: artist.gender,
image: artist.image ? artist.image.large : "",
image: artist.coverArtwork?.image ? artist.coverArtwork.image.large : "",
mainEntityOfPage: `${getENV("APP_URL")}${artist.href}`,
makesOffer,
name: artist.name,
Expand Down
Loading

0 comments on commit 35d1baa

Please sign in to comment.