Skip to content

Commit

Permalink
Merge pull request #2117 from jonallured/on-loan-default-inquiry-message
Browse files Browse the repository at this point in the history
Use sold message for on loan works too
  • Loading branch information
anandaroop authored Jan 31, 2018
2 parents 6ee4411 + a030314 commit 2a6c444
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion desktop/components/contact/default_message.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 7 additions & 1 deletion desktop/components/contact/test/default_message.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2a6c444

Please sign in to comment.