-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from mike-goodwin/development
list-groups
- Loading branch information
Showing
7 changed files
with
93 additions
and
12 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "pug-bootstrap", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"homepage": "https://github.com/mike-goodwin/pug-bootstrap", | ||
"authors": [ | ||
"[email protected]" | ||
|
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,16 @@ | ||
include ../../../components/list-groups | ||
+list-group-custom() | ||
+list-group-item("url1","true") | ||
h4.list-group-item-heading heading1 | ||
p.list-group-item-text | ||
| text1 | ||
|
||
+list-group-item("url2") | ||
h4.list-group-item-heading heading2 | ||
p.list-group-item-text | ||
| text2 | ||
|
||
+list-group-item("url3") | ||
h4.list-group-item-heading heading3 | ||
p.list-group-item-text | ||
| text3 |
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,2 @@ | ||
include ../../../components/list-groups | ||
+list-group-links(items,active) |
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,2 @@ | ||
include ../../../components/list-groups | ||
+list-group(items,active) |
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,54 @@ | ||
var pug = require("pug"); | ||
var assert = require("assert"); | ||
var path = require("path"); | ||
|
||
describe('Simple List Group', function () { | ||
|
||
var items = ['item1', 'item2', 'item3']; | ||
|
||
it('should render a simple list group', function () { | ||
var fn = pug.compileFile(path.join(__dirname, "fixtures/list-groups", 'list-group.pug')); | ||
var actual = '<ul class="list-group"><li class="list-group-item">item1</li><li class="list-group-item active">item2</li><li class="list-group-item">item3</li></ul>'; | ||
var locals = { | ||
items: items, | ||
active: 1 | ||
}; | ||
assert.equal(actual, fn(locals)); | ||
}); | ||
}); | ||
|
||
describe('Link List Group', function () { | ||
|
||
var items = [ | ||
{ | ||
text: 'item1', | ||
url: 'url1' | ||
}, | ||
{ | ||
text: 'item2', | ||
url: 'url2' | ||
}, | ||
{ | ||
text: 'item3', | ||
url: 'url3' | ||
} | ||
]; | ||
|
||
it('should render a link list group', function () { | ||
var fn = pug.compileFile(path.join(__dirname, "fixtures/list-groups", 'list-group-links.pug')); | ||
var actual = '<div class="list-group"><a class="list-group-item" href="url1">item1</a><a class="list-group-item active" href="url2">item2</a><a class="list-group-item" href="url3">item3</a></div>'; | ||
var locals = { | ||
items: items, | ||
active: 1 | ||
}; | ||
assert.equal(actual, fn(locals)); | ||
}); | ||
}); | ||
|
||
describe('Custom List Group', function () { | ||
it('should render a custom list group', function () { | ||
var fn = pug.compileFile(path.join(__dirname, "fixtures/list-groups", 'list-group-custom.pug')); | ||
var actual = '<div class="list-group"><a class="list-group-item active" href="url1"><h4 class="list-group-item-heading">heading1</h4><p class="list-group-item-text">text1</p></a><a class="list-group-item" href="url2"><h4 class="list-group-item-heading">heading2</h4><p class="list-group-item-text">text2</p></a><a class="list-group-item" href="url3"><h4 class="list-group-item-heading">heading3</h4><p class="list-group-item-text">text3</p></a></div>'; | ||
assert.equal(actual, fn()); | ||
}); | ||
}); |