Skip to content

Commit

Permalink
chore: remove AREnableCuratorsPicksAndInterestSignals feature flag (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
oxaudo authored Oct 24, 2024
1 parent 62145d1 commit f0a2fc5
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 214 deletions.
6 changes: 0 additions & 6 deletions src/app/Components/ArtworkGrids/ArtworkGridItem.tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -641,12 +641,6 @@ describe("ArtworkGridItem", () => {
})

describe("social signal", () => {
beforeEach(() => {
__globalStoreTestUtils__?.injectFeatureFlags({
AREnableCuratorsPicksAndInterestSignals: true,
})
})

it("renders the increased interest signal", () => {
renderWithRelay({
Artwork: () => ({
Expand Down
20 changes: 7 additions & 13 deletions src/app/Components/ArtworkGrids/ArtworkGridItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,6 @@ export const Artwork: React.FC<ArtworkProps> = ({
const [showCreateArtworkAlertModal, setShowCreateArtworkAlertModal] = useState(false)
const showBlurhash = useFeatureFlag("ARShowBlurhashImagePlaceholder")
const AREnableAuctionImprovementsSignals = useFeatureFlag("AREnableAuctionImprovementsSignals")
const AREnableCuratorsPicksAndInterestSignals = useFeatureFlag(
"AREnableCuratorsPicksAndInterestSignals"
)

let filterParams: any = undefined

Expand Down Expand Up @@ -364,16 +361,13 @@ export const Artwork: React.FC<ArtworkProps> = ({
</Text>
</Box>
)}
{!isAuction &&
!displayLimitedTimeOfferSignal &&
!!collectorSignals &&
!!AREnableCuratorsPicksAndInterestSignals && (
<ArtworkSocialSignal
collectorSignals={collectorSignals}
hideCuratorsPick={hideCuratorsPickSignal}
hideIncreasedInterest={hideIncreasedInterestSignal}
/>
)}
{!isAuction && !displayLimitedTimeOfferSignal && !!collectorSignals && (
<ArtworkSocialSignal
collectorSignals={collectorSignals}
hideCuratorsPick={hideCuratorsPickSignal}
hideIncreasedInterest={hideIncreasedInterestSignal}
/>
)}
{!!showLotLabel && !!artwork.saleArtwork?.lotLabel && (
<>
<Text variant="xs" numberOfLines={1} caps {...lotLabelTextStyle}>
Expand Down
6 changes: 0 additions & 6 deletions src/app/Components/ArtworkRail/ArtworkRailCard.tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,6 @@ describe("ArtworkRailCard", () => {
})

describe("social signal", () => {
beforeEach(() => {
__globalStoreTestUtils__?.injectFeatureFlags({
AREnableCuratorsPicksAndInterestSignals: true,
})
})

it("renders the increased interest signal", () => {
renderWithRelay({
Artwork: () => ({
Expand Down
22 changes: 8 additions & 14 deletions src/app/Components/ArtworkRail/ArtworkRailCardMeta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ export const ArtworkRailCardMeta: React.FC<ArtworkRailCardMetaProps> = ({
}) => {
const { trackEvent } = useTracking()
const enableAuctionImprovementsSignals = useFeatureFlag("AREnableAuctionImprovementsSignals")
const enableCuratorsPicksAndInterestSignals = useFeatureFlag(
"AREnableCuratorsPicksAndInterestSignals"
)

const artwork = useFragment(artworkMetaFragment, artworkProp)

Expand Down Expand Up @@ -151,17 +148,14 @@ export const ArtworkRailCardMeta: React.FC<ArtworkRailCardMetaProps> = ({
</Box>
)}

{!sale?.isAuction &&
!displayLimitedTimeOfferSignal &&
!!collectorSignals &&
!!enableCuratorsPicksAndInterestSignals && (
<ArtworkSocialSignal
collectorSignals={collectorSignals}
hideCuratorsPick={hideCuratorsPickSignal}
hideIncreasedInterest={hideIncreasedInterestSignal}
dark={dark}
/>
)}
{!sale?.isAuction && !displayLimitedTimeOfferSignal && !!collectorSignals && (
<ArtworkSocialSignal
collectorSignals={collectorSignals}
hideCuratorsPick={hideCuratorsPickSignal}
hideIncreasedInterest={hideIncreasedInterestSignal}
dark={dark}
/>
)}

{!!lotLabel && (
<Text lineHeight="20px" color={secondaryTextColor} numberOfLines={1}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { screen } from "@testing-library/react-native"
import { ArtworkDetailsCollectorSignal } from "app/Scenes/Artwork/Components/ArtworkDetailsCollectorSignal"
import { __globalStoreTestUtils__ } from "app/store/GlobalStore"
import { setupTestWrapper } from "app/utils/tests/setupTestWrapper"
import { graphql } from "react-relay"

Expand All @@ -16,179 +15,108 @@ describe("ArtworkDetailsCollectorSignal", () => {
`,
})

describe("when EnableCuratorsPicksAndInterestSignals flag is disabled", () => {
beforeEach(() => {
__globalStoreTestUtils__?.injectFeatureFlags({
AREnableCuratorsPicksAndInterestSignals: false,
})
it("does not render signals if they are not present", () => {
renderWithRelay({
Artwork: () => ({
collectorSignals: {
curatorsPick: false,
increasedInterest: false,
runningShow: null,
},
}),
})

it("renders showing now signal even when curator pic and increased interest is present", () => {
renderWithRelay({
Artwork: () => ({
collectorSignals: {
curatorsPick: true,
increasedInterest: true,
runningShow: {
name: "Saenger Galería at The Armory Show 2024",
href: "/show/saenger-galeria-saenger-galeria-at-the-armory-show-2024-1",
startAt: "2024-08-28T00:00:00+00:00",
endAt: "2024-09-22T00:00:00+00:00",
},
},
}),
})

expect(screen.getByText(/Showing now/)).toBeOnTheScreen()
expect(screen.queryByText(/Curators’ Pick/)).not.toBeOnTheScreen()
expect(screen.queryByText(/Increased Interest/)).not.toBeOnTheScreen()
})
expect(screen.queryByText(/Curators’ Pick/)).not.toBeOnTheScreen()
expect(screen.queryByText(/Increased Interest/)).not.toBeOnTheScreen()
expect(screen.queryByText(/Showing now/)).not.toBeOnTheScreen()
})

it("renders showing now signal when running show is present", () => {
renderWithRelay({
Artwork: () => ({
collectorSignals: {
runningShow: {
name: "Saenger Galería at The Armory Show 2024",
href: "/show/saenger-galeria-saenger-galeria-at-the-armory-show-2024-1",
startAt: "2024-08-28T00:00:00+00:00",
endAt: "2024-09-22T00:00:00+00:00",
},
it("renders showing now signal when running show is present and other signals are not", () => {
renderWithRelay({
Artwork: () => ({
collectorSignals: {
curatorsPick: false,
increasedInterest: false,
runningShow: {
name: "Saenger Galería at The Armory Show 2024",
href: "/show/saenger-galeria-saenger-galeria-at-the-armory-show-2024-1",
startAt: "2024-08-28T00:00:00+00:00",
endAt: "2024-09-22T00:00:00+00:00",
},
}),
})

expect(screen.getByText(/Showing now/)).toBeOnTheScreen()
expect(screen.getByText(/Saenger Galería at The Armory Show 2024/)).toBeOnTheScreen()
},
}),
})

it("doesn't render if running show is not present even if others present", () => {
renderWithRelay({
Artwork: () => ({
collectorSignals: {
runningShow: null,
curatorsPick: true,
increasedInterest: true,
},
}),
})

expect(screen.queryByText(/Curators’ Pick/)).not.toBeOnTheScreen()
expect(screen.queryByText(/Increased Interest/)).not.toBeOnTheScreen()
expect(screen.queryByText(/Showing now/)).not.toBeOnTheScreen()
})
expect(screen.queryByText(/Curators’ Pick/)).not.toBeOnTheScreen()
expect(screen.queryByText(/Increased Interest/)).not.toBeOnTheScreen()
expect(screen.getByText(/Showing now/)).toBeOnTheScreen()
expect(screen.getByText(/Saenger Galería at The Armory Show 2024/)).toBeOnTheScreen()
})

describe("when EnableCuratorsPicksAndInterestSignals flag is enabled", () => {
beforeEach(() => {
__globalStoreTestUtils__?.injectFeatureFlags({
AREnableCuratorsPicksAndInterestSignals: true,
})
})

it("does not render signals if they are not present", () => {
renderWithRelay({
Artwork: () => ({
collectorSignals: {
curatorsPick: false,
increasedInterest: false,
runningShow: null,
},
}),
})

expect(screen.queryByText(/Curators’ Pick/)).not.toBeOnTheScreen()
expect(screen.queryByText(/Increased Interest/)).not.toBeOnTheScreen()
expect(screen.queryByText(/Showing now/)).not.toBeOnTheScreen()
})

it("renders showing now signal when running show is present and other signals are not", () => {
renderWithRelay({
Artwork: () => ({
collectorSignals: {
curatorsPick: false,
increasedInterest: false,
runningShow: {
name: "Saenger Galería at The Armory Show 2024",
href: "/show/saenger-galeria-saenger-galeria-at-the-armory-show-2024-1",
startAt: "2024-08-28T00:00:00+00:00",
endAt: "2024-09-22T00:00:00+00:00",
},
it("doesn't render showing now if running show is present but other signals are present as well", () => {
renderWithRelay({
Artwork: () => ({
collectorSignals: {
curatorsPick: true,
increasedInterest: false,
runningShow: {
name: "Saenger Galería at The Armory Show 2024",
href: "/show/saenger-galeria-saenger-galeria-at-the-armory-show-2024-1",
startAt: "2024-08-28T00:00:00+00:00",
endAt: "2024-09-22T00:00:00+00:00",
},
}),
})

expect(screen.queryByText(/Curators’ Pick/)).not.toBeOnTheScreen()
expect(screen.queryByText(/Increased Interest/)).not.toBeOnTheScreen()
expect(screen.getByText(/Showing now/)).toBeOnTheScreen()
expect(screen.getByText(/Saenger Galería at The Armory Show 2024/)).toBeOnTheScreen()
},
}),
})

it("doesn't render showing now if running show is present but other signals are present as well", () => {
renderWithRelay({
Artwork: () => ({
collectorSignals: {
curatorsPick: true,
increasedInterest: false,
runningShow: {
name: "Saenger Galería at The Armory Show 2024",
href: "/show/saenger-galeria-saenger-galeria-at-the-armory-show-2024-1",
startAt: "2024-08-28T00:00:00+00:00",
endAt: "2024-09-22T00:00:00+00:00",
},
},
}),
})
expect(screen.queryByText(/Showing now/)).not.toBeOnTheScreen()
})

expect(screen.queryByText(/Showing now/)).not.toBeOnTheScreen()
it("renders the curators pick signal", () => {
renderWithRelay({
Artwork: () => ({
collectorSignals: {
increasedInterest: false,
curatorsPick: true,
},
}),
})

it("renders the curators pick signal", () => {
renderWithRelay({
Artwork: () => ({
collectorSignals: {
increasedInterest: false,
curatorsPick: true,
},
}),
})
expect(screen.getByText(/Curators’ Pick/)).toBeOnTheScreen()
expect(screen.getByText(/Hand selected by Artsy curators this week/)).toBeOnTheScreen()
expect(screen.queryByText(/Increased Interest/)).not.toBeOnTheScreen()
expect(screen.queryByText(/Showing now/)).not.toBeOnTheScreen()
})

expect(screen.getByText(/Curators’ Pick/)).toBeOnTheScreen()
expect(screen.getByText(/Hand selected by Artsy curators this week/)).toBeOnTheScreen()
expect(screen.queryByText(/Increased Interest/)).not.toBeOnTheScreen()
expect(screen.queryByText(/Showing now/)).not.toBeOnTheScreen()
it("renders the curator's pick signal even when there's an increased interest signal", () => {
renderWithRelay({
Artwork: () => ({
collectorSignals: {
increasedInterest: true,
curatorsPick: true,
},
}),
})

it("renders the curator's pick signal even when there's an increased interest signal", () => {
renderWithRelay({
Artwork: () => ({
collectorSignals: {
increasedInterest: true,
curatorsPick: true,
},
}),
})
expect(screen.getByText(/Curators’ Pick/)).toBeOnTheScreen()
expect(screen.getByText(/Hand selected by Artsy curators this week/)).toBeOnTheScreen()
expect(screen.queryByText(/Increased Interest/)).not.toBeOnTheScreen()
expect(screen.queryByText(/Showing now/)).not.toBeOnTheScreen()
})

expect(screen.getByText(/Curators’ Pick/)).toBeOnTheScreen()
expect(screen.getByText(/Hand selected by Artsy curators this week/)).toBeOnTheScreen()
expect(screen.queryByText(/Increased Interest/)).not.toBeOnTheScreen()
expect(screen.queryByText(/Showing now/)).not.toBeOnTheScreen()
it("renders the increased interest signal", () => {
renderWithRelay({
Artwork: () => ({
collectorSignals: {
increasedInterest: true,
curatorsPick: false,
},
}),
})

it("renders the increased interest signal", () => {
renderWithRelay({
Artwork: () => ({
collectorSignals: {
increasedInterest: true,
curatorsPick: false,
},
}),
})

expect(screen.getByText(/Increased Interest/)).toBeOnTheScreen()
expect(screen.getByText(/Based on collector activity in the past 14 days/)).toBeOnTheScreen()
expect(screen.queryByText(/Curators’ Pick/)).not.toBeOnTheScreen()
expect(screen.queryByText(/Showing now/)).not.toBeOnTheScreen()
})
expect(screen.getByText(/Increased Interest/)).toBeOnTheScreen()
expect(screen.getByText(/Based on collector activity in the past 14 days/)).toBeOnTheScreen()
expect(screen.queryByText(/Curators’ Pick/)).not.toBeOnTheScreen()
expect(screen.queryByText(/Showing now/)).not.toBeOnTheScreen()
})
})
Loading

0 comments on commit f0a2fc5

Please sign in to comment.