Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndrew Fanton <andrew.fanton@ryansg.com>2019-05-22 11:09:12 -0400
committerAndrew Fanton <andrew.fanton@ryansg.com>2019-05-28 16:33:08 -0400
commitf569a7e94d4fd6da125c2f01fdcb3f80b88a1703 (patch)
tree48df4c651730bc3490704f4f09b7ca205ab8eef8 /test
parent5a5c2ca629603e8a0dfb6323a40ef7e2fda0216c (diff)
downloadliza-f569a7e94d4fd6da125c2f01fdcb3f80b88a1703.tar.gz
liza-f569a7e94d4fd6da125c2f01fdcb3f80b88a1703.tar.bz2
liza-f569a7e94d4fd6da125c2f01fdcb3f80b88a1703.zip
[DEV-3514] Display message explaining why quote is locked
Prior to this change, a single generic message was always shown simply stating that the quote had been locked. These changes now allow for different messages to be displayed in different circumstances.
Diffstat (limited to 'test')
-rw-r--r--test/quote/BaseQuoteTest.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/quote/BaseQuoteTest.js b/test/quote/BaseQuoteTest.js
index 5087431..f1ba018 100644
--- a/test/quote/BaseQuoteTest.js
+++ b/test/quote/BaseQuoteTest.js
@@ -27,6 +27,12 @@ const { BaseQuote } = require( '../../' ).quote;
const Program = require( '../../src/program/Program' ).Program;
const Util = require( '../../src/test/program/util' );
+const messages = {
+ expire: 'This quote has expired and cannot be modified. ' +
+ 'Please contact support with any questions.',
+ bound: 'This quote has been bound and cannot be modified.'
+};
+
describe( 'BaseQuote', () =>
{
describe( 'accessors & mutators', () =>
@@ -143,7 +149,7 @@ describe( 'BaseQuote', () =>
},
{
description: 'bound quote',
- reason: { given: '', expected: 'Quote has been bound' },
+ reason: { given: '', expected: messages.bound },
step: 0,
bound: true,
imported: false,
@@ -159,7 +165,7 @@ describe( 'BaseQuote', () =>
},
{
description: 'bound and imported quote',
- reason: { given: '', expected: 'Quote has been bound' },
+ reason: { given: '', expected: messages.bound },
step: 0,
bound: true,
imported: true,
@@ -167,7 +173,7 @@ describe( 'BaseQuote', () =>
},
{
description: 'bound quote with a lock on step #2',
- reason: { given: '', expected: 'Quote has been bound' },
+ reason: { given: '', expected: messages.bound },
step: { given: 2, expected: 0 },
bound: true,
imported: false,
@@ -218,7 +224,7 @@ describe( 'BaseQuote', () =>
expect( quote.isLocked() ).to.equal( locks );
quote.clearExplicitLock();
- expect( quote.getExplicitLockReason() ).to.equal( bound ? 'Quote has been bound' : '' );
+ expect( quote.getExplicitLockReason() ).to.equal( bound ? messages.bound : '' );
expect( quote.getExplicitLockStep() ).to.equal( 0 );
} );
} );