From 1270de8881faa1c5af7a6513bc804fa81c4bb94a Mon Sep 17 00:00:00 2001 From: thylux Date: Sun, 29 Jan 2017 01:16:59 +0000 Subject: [PATCH 1/3] Corrected textarea-simple to include name attribute --- components/forms.pug | 2 +- test/forms.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/forms.pug b/components/forms.pug index 9634ef7..ce31c29 100644 --- a/components/forms.pug +++ b/components/forms.pug @@ -19,7 +19,7 @@ mixin textarea(id,placeholder,label,name,rows) //- Simple form input control without a form-group mixin textarea-simple(id,placeholder,rows) - rows = rows || 3 //- Default of 3 rows - textarea.form-control(id=id,placeholder=placeholder,rows=rows) + textarea.form-control(id=id,placeholder=placeholder,name=id,rows=rows) //- Checkbox - Block style mixin checkbox(text,name,id) diff --git a/test/forms.js b/test/forms.js index ddb15f3..229faf8 100644 --- a/test/forms.js +++ b/test/forms.js @@ -20,7 +20,7 @@ describe("Forms", function() { it("should generate simple text area control", function() { var fn = pug.compileFile(path.join(__dirname, "fixtures/forms","textarea-simple.pug")); - assert.equal('',fn({id: "txtInput",placeholder:"Placeholder"})); + assert.equal('',fn({id: "txtInput",placeholder:"Placeholder"})); }); it("should generate a checkbox",function() { From 63a4b3b2d06a553d26927ca647afa06689cfe50c Mon Sep 17 00:00:00 2001 From: thylux Date: Sun, 29 Jan 2017 01:23:10 +0000 Subject: [PATCH 2/3] Corrected input-simple to include name attribute --- components/forms.pug | 2 +- test/forms.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/forms.pug b/components/forms.pug index ce31c29..0768775 100644 --- a/components/forms.pug +++ b/components/forms.pug @@ -7,7 +7,7 @@ mixin input(type,id,placeholder,label,name) //- Simple form input control without a form-group mixin input-simple(type,id,placeholder) - input.form-control(type=type,id=id,placeholder=placeholder) + input.form-control(type=type,id=id,placeholder=placeholder,name=id) //- Input control with form-group wrapper mixin textarea(id,placeholder,label,name,rows) diff --git a/test/forms.js b/test/forms.js index 229faf8..371ebd6 100644 --- a/test/forms.js +++ b/test/forms.js @@ -10,7 +10,7 @@ describe("Forms", function() { it("should generate simple input control", function() { var fn = pug.compileFile(path.join(__dirname, "fixtures/forms","input-simple.pug")); - assert.equal('',fn({type: "text", id: "txtInput",placeholder:"Placeholder"})); + assert.equal('',fn({type: "text", id: "txtInput",placeholder:"Placeholder"})); }); it("should generate text area control", function() { From 77f7b2fdc728d14dc9b3ecd521bfbfcaf7e4de5a Mon Sep 17 00:00:00 2001 From: mike-goodwin Date: Sun, 29 Jan 2017 20:02:16 +0000 Subject: [PATCH 3/3] Fixed unit tests Unrelated (but otherwise harmless) breaking change in pug was causing tests to fail --- test/progress-bar.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/progress-bar.js b/test/progress-bar.js index d98eecf..24b1ea8 100644 --- a/test/progress-bar.js +++ b/test/progress-bar.js @@ -5,27 +5,27 @@ var path = require("path"); describe("Progress bars", function() { it("should generate a generic progress bar",function() { var fn = pug.compileFile(path.join(__dirname,"fixtures/progress-bar","progress-bar.pug")); - assert.equal('
60% Complete
',fn({value: 60,type: "primary" })); + assert.equal('
60% Complete
',fn({value: 60,type: "primary" })); }); it("should generate a primary progress bar",function() { var fn = pug.compileFile(path.join(__dirname,"fixtures/progress-bar","progress-bar-primary.pug")); - assert.equal('
60% Complete
',fn({value: 60 })); + assert.equal('
60% Complete
',fn({value: 60 })); }); it("should generate a info progress bar",function() { var fn = pug.compileFile(path.join(__dirname,"fixtures/progress-bar","progress-bar-info.pug")); - assert.equal('
60% Complete
',fn({value: 60 })); + assert.equal('
60% Complete
',fn({value: 60 })); }); it("should generate a warning progress bar",function() { var fn = pug.compileFile(path.join(__dirname,"fixtures/progress-bar","progress-bar-warning.pug")); - assert.equal('
60% Complete
',fn({value: 60 })); + assert.equal('
60% Complete
',fn({value: 60 })); }); it("should generate a danger progress bar",function() { var fn = pug.compileFile(path.join(__dirname,"fixtures/progress-bar","progress-bar-danger.pug")); - assert.equal('
60% Complete
',fn({value: 60 })); + assert.equal('
60% Complete
',fn({value: 60 })); }); it("should generate a success progress bar",function() { var fn = pug.compileFile(path.join(__dirname,"fixtures/progress-bar","progress-bar-success.pug")); - assert.equal('
60% Complete
',fn({value: 60})); + assert.equal('
60% Complete
',fn({value: 60})); }); });