-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
51 lines (49 loc) · 1.02 KB
/
Copy pathindex.js
File metadata and controls
51 lines (49 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Form Generation TEST
const formTool = require('./FormGenerator.js');
const test = [{
type: 'label',
name: 'labelName',
for: 'labelFor',
id: 'labelID',
class: 'labelClass',
value: 'labelValue',
required: true,
}, {
type: 'text',
name: 'textName',
// without id
class: 'textClass',
value: 'textValue',
required: false,
}, {
type: 'email',
name: 'emailName',
id: 'emailID',
class: 'emailClass',
value: 'emailValue',
// without require
}, {
type: 'password',
name: 'passwordName',
id: 'passwordID',
class: 'passwordClass',
// without value
required: true,
}, {
type: 'submit',
// without name
id: 'submitID',
class: 'submitClass',
value: 'submitValue',
// without require
}, {
type: 'withoutType',
name: 'shouldThrowError',
id: 'thisWontWork',
// without class
value: 'doesntMatter',
require: 'other',
}];
// Ignore console.log fail for this app's purposes
// eslint-disable-next-line no-console
console.log('HTML Form Results: \n', formTool.formGeneration(test));