Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added in testing suite and finished list number
- Loading branch information
1 parent
9df4630
commit 4d75e0b
Showing
8 changed files
with
1,097 additions
and
28 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 @@ | ||
src/tpls/ |
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules/ | ||
jsconfig.json | ||
.vscode | ||
.vscode | ||
.nyc_output |
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
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
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,8 @@ | ||
{ | ||
"env": { | ||
"mocha": true | ||
}, | ||
"rules": { | ||
"no-unused-expressions": 0 | ||
} | ||
} |
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,40 @@ | ||
const expect = require('chai').expect | ||
const sinon = require('sinon') | ||
const utils = require('../../src/utils/index.js') | ||
|
||
const { buildNumberListInquiry } = utils | ||
|
||
describe('Utility Funcitons', () => { | ||
describe('#buildNumberListInquiry()', () => { | ||
describe('-> with AllowedValues', () => { | ||
const ConstraintDescription = 'Only 1 2 or 3' | ||
const Description = 'Choose a number 1 through 3' | ||
|
||
it('should set the inquiry with choices equal to AllowedValues and handle Number choices and defaults', () => { | ||
const param = { | ||
Default: 1, | ||
AllowedValues: [1, 2, 3], | ||
ConstraintDescription, | ||
Description, | ||
} | ||
const name = 'ParamNumbersList' | ||
const testCase = { | ||
type: 'checkbox', | ||
name, | ||
message: param.Description, | ||
default: 1, | ||
choices: [ | ||
{ name: 1, value: 1, checked: true }, | ||
{ name: 2, value: 2 }, | ||
{ name: 3, value: 3 }, | ||
], | ||
} | ||
const result = buildNumberListInquiry(param, name) | ||
const { filter, ...props } = result | ||
|
||
expect(props).to.deep.equal(testCase) | ||
expect(filter([1, 3])).to.equal('1,3') | ||
}) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.