| 5 | import Form from '../src/Form.js' |
| 6 | |
| 7 | function getExampleFieldSpecs () { |
| 8 | const fieldSpecs = [ |
| 9 | { |
| 10 | name: 'includeForeignChars', |
| 11 | type: 'boolean', |
| 12 | label: 'Foreign Chars', |
| 13 | value: false, |
| 14 | trueLabel: 'Include', |
| 15 | falseLabel: 'Ignore', |
| 16 | randomizable: false |
| 17 | }, |
| 18 | { |
| 19 | name: 'invisible', |
| 20 | type: 'enum', |
| 21 | value: '?', |
| 22 | elements: ['?', '!'], |
| 23 | visible: false, |
| 24 | priority: -10 |
| 25 | }, |
| 26 | { |
| 27 | name: 'model', |
| 28 | type: 'enum', |
| 29 | value: 'I', |
| 30 | elements: ['I'], |
| 31 | randomizable: false, |
| 32 | priority: 100 |
| 33 | } |
| 34 | ] |
| 35 | for (let i = 1; i <= 3; i++) { |
| 36 | fieldSpecs.push({ |
| 37 | name: `rotor${i}`, |
| 38 | label: `Rotor ${i}`, |
| 39 | type: 'enum', |
| 40 | value: 'I', |
| 41 | elements: ['I', 'II', 'III', 'IV', 'V'] |
| 42 | }) |
| 43 | fieldSpecs.push({ |
| 44 | name: `position${i}`, |
| 45 | label: `Position ${i}`, |
| 46 | type: 'number', |
| 47 | value: 1, |
| 48 | integer: true, |
| 49 | min: 1, |
| 50 | max: 27 |
| 51 | }) |
| 52 | } |
| 53 | return fieldSpecs |
| 54 | } |
| 55 | |
| 56 | /** @test {Form} */ |
| 57 | describe('Form', () => { |