From a030314f238bc7c717c80511501c636c5aeeee39 Mon Sep 17 00:00:00 2001 From: Jon Allured Date: Mon, 29 Jan 2018 09:51:16 -0600 Subject: [PATCH] Use sold message for on loan works too Per @madeleineb on #AS-7, use the sold message for on-loan works too. --- desktop/components/contact/default_message.coffee | 2 +- desktop/components/contact/test/default_message.coffee | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/desktop/components/contact/default_message.coffee b/desktop/components/contact/default_message.coffee index 14706f9361b..ef286c5201c 100644 --- a/desktop/components/contact/default_message.coffee +++ b/desktop/components/contact/default_message.coffee @@ -3,7 +3,7 @@ module.exports = (artwork, partner) -> 'Hello, I am interested in placing a bid on this work. ' + 'Please send me more information.' else - if artwork.get('availability') is 'sold' + if artwork.get('availability') in ['sold', 'on loan'] 'Hi, I’m interested in similar works by this artist. ' + 'Could you please let me know if you have anything available?' else if artwork.get('availability') isnt 'not for sale' diff --git a/desktop/components/contact/test/default_message.coffee b/desktop/components/contact/test/default_message.coffee index 1b0fd803ddb..98303cca1dc 100644 --- a/desktop/components/contact/test/default_message.coffee +++ b/desktop/components/contact/test/default_message.coffee @@ -25,12 +25,18 @@ describe 'defaultMessage', -> .should.equal 'Hi, I’m interested in purchasing this work. ' + 'Could you please provide more information about the piece?' - it 'returns a cusotm message when the artwork is sold', -> + it 'returns the similar message when the artwork is sold', -> @artwork.set availability: 'sold' defaultMessage @artwork, @partner .should.equal 'Hi, I’m interested in similar works by this artist. ' + 'Could you please let me know if you have anything available?' + it 'returns the similar message when the artwork is on loan', -> + @artwork.set availability: 'on loan' + defaultMessage @artwork, @partner + .should.equal 'Hi, I’m interested in similar works by this artist. ' + + 'Could you please let me know if you have anything available?' + it 'returns nothing when the artwork is not for sale', -> @artwork.set availability: 'not for sale' (typeof defaultMessage @artwork, @partner)