Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update NSO and inquiry FAQ link on artwork sidebar (PURCHASE-1885) #5721

Merged
merged 3 commits into from
Jun 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Container = ({ children }) => (
context_module: Schema.ContextModule.Sidebar,
})
class ArtworkSidebarExtraLinksContainer extends React.Component<
ArtworkSidebarExtraLinksContainerProps
ArtworkSidebarExtraLinksContainerProps
> {
@track(() => ({
action_type: Schema.ActionType.Click,
Expand Down Expand Up @@ -55,7 +55,10 @@ ArtworkSidebarExtraLinksContainerProps
type: Schema.Type.Link,
}))
onClickBuyNowFAQ() {
window.open(sd.APP_URL + "/buy-now-feature-faq", "_blank")
window.open(
"https://support.artsy.net/hc/en-us/sections/360008203114-Buy-Now-and-Make-Offer",
zephraph marked this conversation as resolved.
Show resolved Hide resolved
"_blank"
)
}

@track(() => ({
Expand All @@ -64,9 +67,10 @@ ArtworkSidebarExtraLinksContainerProps
type: Schema.Type.Link,
}))
onClickCollectorFAQ() {
this.props.mediator &&
this.props.mediator.trigger &&
this.props.mediator.trigger("openCollectorFAQModal")
window.open(
"https://support.artsy.net/hc/en-us/sections/360008203054-Contact-a-gallery",
"_blank"
)
}

@track(() => ({
Expand Down Expand Up @@ -150,7 +154,9 @@ ArtworkSidebarExtraLinksContainerProps
return (
<Container>
Have a question?{" "}
<Link onClick={this.onClickBuyNowFAQ.bind(this)}>Read our FAQ</Link>{" "}
<Link onClick={this.onClickBuyNowFAQ.bind(this)}>
Visit our help center
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed that we track clicks for Buy Now FAQ link and Collector FAQ link below. I assume the CTA copy changes may effect how users interact with the page. Do we want to modify the tracking or are we fine keeping the existing tracking as is? cc @anipetrov

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's change the label property to the new CTA please!

</Link>{" "}
or{" "}
<Link onClick={this.onClickBuyNowAskSpecialist.bind(this)}>
ask a specialist
Expand All @@ -164,7 +170,7 @@ ArtworkSidebarExtraLinksContainerProps
<Container>
Have a question?{" "}
<Link onClick={this.onClickCollectorFAQ.bind(this)}>
Read our FAQ
Visit our help center
</Link>
.
</Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ describe("ArtworkSidebarExtraLinks", () => {
})
it("displays conditions of sale link that opens conditions of sale page", () => {
expect(wrapper.find('a[children="Conditions of Sale"]').length).toBe(1)
wrapper
.find('a[children="Conditions of Sale"]')
.at(0)
.simulate("click")
wrapper.find('a[children="Conditions of Sale"]').at(0).simulate("click")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the large diff here. Looks like there was some prettier update that caused the format changes. Probably safe to ignore.


expect(window.open).toHaveBeenCalledWith(
expect.stringMatching(/conditions-of-sale/),
Expand All @@ -103,26 +100,17 @@ describe("ArtworkSidebarExtraLinks", () => {
})
it("displays FAQ link that brings auction FAQ modal", () => {
expect(wrapper.find('a[children="auction FAQs"]').length).toBe(1)
wrapper
.find('a[children="auction FAQs"]')
.at(0)
.simulate("click")
wrapper.find('a[children="auction FAQs"]').at(0).simulate("click")
// TODO: verify mediator call with openAuctionFAQModal
})
it("displays ask a specialist link that brings ask an auction specialist modal", () => {
expect(wrapper.find('a[children="ask a specialist"]').length).toBe(1)
wrapper
.find('a[children="ask a specialist"]')
.at(0)
.simulate("click")
wrapper.find('a[children="ask a specialist"]').at(0).simulate("click")
// TODO: verify mediator call with openAuctionAskSpecialistModal
})
it("displays consign link that opens consign page", () => {
expect(wrapper.find('a[children="Consign with Artsy"]').length).toBe(1)
wrapper
.find('a[children="Consign with Artsy"]')
.at(0)
.simulate("click")
wrapper.find('a[children="Consign with Artsy"]').at(0).simulate("click")

expect(window.open).toHaveBeenCalledWith(
expect.stringMatching(/consign/),
Expand All @@ -137,37 +125,33 @@ describe("ArtworkSidebarExtraLinks", () => {
})
it("displays proper text", () => {
expect(wrapper.text()).toContain(
"Have a question? Read our FAQ or ask a specialist."
"Have a question? Visit our help center or ask a specialist."
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are real changes.

)
expect(wrapper.text()).toContain(
"Want to sell a work by this artist? Consign with Artsy."
)
})
it("displays FAQ link that opens Buy now FAQ page", () => {
expect(wrapper.find('a[children="Read our FAQ"]').length).toBe(1)
it("displays help center link that opens help center page", () => {
expect(wrapper.find('a[children="Visit our help center"]').length).toBe(1)
wrapper
.find('a[children="Read our FAQ"]')
.find('a[children="Visit our help center"]')
.at(0)
.simulate("click")
expect(window.open).toHaveBeenCalledWith(
expect.stringMatching(/buy-now-feature-faq/),
expect.stringMatching(
"https://support.artsy.net/hc/en-us/sections/360008203114-Buy-Now-and-Make-Offer"
),
"_blank"
)
})
it("displays ask a specialist link that brings ask sale specialist modal", () => {
expect(wrapper.find('a[children="ask a specialist"]').length).toBe(1)
wrapper
.find('a[children="ask a specialist"]')
.at(0)
.simulate("click")
wrapper.find('a[children="ask a specialist"]').at(0).simulate("click")
// TODO: verify mediator call with openBuyNowAskSpecialistModal
})
it("displays consign link that opens consign page", () => {
expect(wrapper.find('a[children="Consign with Artsy"]').length).toBe(1)
wrapper
.find('a[children="Consign with Artsy"]')
.at(0)
.simulate("click")
wrapper.find('a[children="Consign with Artsy"]').at(0).simulate("click")

expect(window.open).toHaveBeenCalledWith(
expect.stringMatching(/consign/),
Expand All @@ -184,25 +168,29 @@ describe("ArtworkSidebarExtraLinks", () => {
})

it("displays proper text", () => {
expect(wrapper.text()).toContain("Have a question? Read our FAQ.")
expect(wrapper.text()).toContain(
"Have a question? Visit our help center."
)
expect(wrapper.text()).toContain(
"Want to sell a work by these artists? Consign with Artsy."
)
})
it("displays FAQ link that brings collector FAQ modal", () => {
expect(wrapper.find('a[children="Read our FAQ"]').length).toBe(1)
it("displays help center link that opens help center page", () => {
expect(wrapper.find('a[children="Visit our help center"]').length).toBe(1)
wrapper
.find('a[children="Read our FAQ"]')
.find('a[children="Visit our help center"]')
.at(0)
.simulate("click")
// TODO: verify mediator call with openCollectorFAQModal
expect(window.open).toHaveBeenCalledWith(
expect.stringMatching(
"https://support.artsy.net/hc/en-us/sections/360008203054-Contact-a-gallery"
),
"_blank"
)
})
it("displays consign link that opens consign page", () => {
expect(wrapper.find('a[children="Consign with Artsy"]').length).toBe(1)
wrapper
.find('a[children="Consign with Artsy"]')
.at(0)
.simulate("click")
wrapper.find('a[children="Consign with Artsy"]').at(0).simulate("click")

expect(window.open).toHaveBeenCalledWith(
expect.stringMatching(/consign/),
Expand All @@ -223,10 +211,7 @@ describe("ArtworkSidebarExtraLinks", () => {
})
it("displays consign link that opens consign page", () => {
expect(wrapper.find('a[children="Consign with Artsy"]').length).toBe(1)
wrapper
.find('a[children="Consign with Artsy"]')
.at(0)
.simulate("click")
wrapper.find('a[children="Consign with Artsy"]').at(0).simulate("click")

expect(window.open).toHaveBeenCalledWith(
expect.stringMatching(/consign/),
Expand Down
34 changes: 8 additions & 26 deletions src/v2/Apps/Order/Components/__tests__/StickyFooter.jest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ describe("Sticky footer", () => {
<StickyFooter orderType="OFFER" artworkId="whatever" />
)

component
.find("a")
.at(0)
.simulate("click")
component.find("a").at(0).simulate("click")

expect(window.open).toHaveBeenCalledWith(
"https://www.artsy.net/buy-now-feature-faq",
Expand All @@ -50,10 +47,7 @@ describe("Sticky footer", () => {
</SystemContextProvider>
)

component
.find("a")
.at(1)
.simulate("click")
component.find("a").at(1).simulate("click")

expect(mediatorMock.trigger).toHaveBeenCalledWith(
"openOrdersContactArtsyModal",
Expand All @@ -79,13 +73,10 @@ describe("Sticky footer", () => {
const component = mount(
<Component orderType="OFFER" artworkId="whatever" />
)
component
.find(Link)
.at(0)
.simulate("click")
component.find(Link).at(0).simulate("click")
expect(dispatch).toBeCalledWith({
action_type: "Click",
subject: "read faq",
subject: "Visit our help center",
flow: "make offer",
type: "button",
})
Expand All @@ -99,10 +90,7 @@ describe("Sticky footer", () => {
<Component orderType="OFFER" artworkId="whatever" />
</SystemContextProvider>
)
component
.find(Link)
.last()
.simulate("click")
component.find(Link).last().simulate("click")

expect(dispatch).toBeCalledWith({
action_type: "Click",
Expand All @@ -120,13 +108,10 @@ describe("Sticky footer", () => {
const component = mount(
<Component orderType="BUY" artworkId="whatever" />
)
component
.find(Link)
.at(0)
.simulate("click")
component.find(Link).at(0).simulate("click")
expect(dispatch).toBeCalledWith({
action_type: "Click",
subject: "read faq",
subject: "Visit our help center",
flow: "buy now",
type: "button",
})
Expand All @@ -140,10 +125,7 @@ describe("Sticky footer", () => {
<Component orderType="BUY" artworkId="whatever" />
</SystemContextProvider>
)
component
.find(Link)
.last()
.simulate("click")
component.find(Link).last().simulate("click")

expect(dispatch).toBeCalledWith({
action_type: "Click",
Expand Down
4 changes: 2 additions & 2 deletions src/v2/Artsy/Analytics/Schema/Values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export enum Subject {
* Buy now checkout flow
*/
BNMOAskSpecialist = "ask a specialist",
BNMOReadFAQ = "read faq",
BNMOReadFAQ = "Visit our help center",
BNMOProvideShipping = "provide shipping address",
BNMOArrangePickup = "arrange for pickup",
BNMOUseShippingAddress = "use shipping address",
Expand All @@ -252,7 +252,7 @@ export enum Subject {
AuctionAskSpecialist = "ask a specialist",
AuctionBuyerPremium = "Buyer premium",

CollectorFAQ = "collector faq",
CollectorFAQ = "Visit our help center",

ConsignLearnMore = "learn more",

Expand Down