forked from alexeisnyk/juice-shop
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8a5ab1
commit 48760d4
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (c) 2014-2021 Bjoern Kimminich. | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
const chai = require('chai') | ||
const expect = chai.expect | ||
const insecurity = require('../../lib/insecurity') | ||
|
||
describe('botUtils', () => { | ||
const botUtils = require('../../lib/botUtils') | ||
|
||
describe('testFunction', () => { | ||
it('returns static test response', () => { | ||
expect(botUtils.testFunction()).to.deep.equal({ | ||
action: 'response', | ||
body: '3be2e438b7f3d04c89d7749f727bb3bd' | ||
}) | ||
}) | ||
}) | ||
|
||
describe('couponCode', () => { | ||
it('response contains a valid 10% coupon code for current date', () => { | ||
expect(botUtils.couponCode()).to.deep.equal({ | ||
action: 'response', | ||
body: `Oooookay, if you promise to stop nagging me here's a 10% coupon code for you: ${insecurity.generateCoupon(10, new Date())}` | ||
}) | ||
}) | ||
}) | ||
}) |