Skip to content

Commit addac85

Browse files
committed
Add test for custom print style
1 parent f998e2d commit addac85

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

test/books/style-print/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Readme
2+
3+
Default description for the book.

test/books/style-print/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Summary
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
color: red;
3+
}

test/ebook.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,35 @@ describe('eBook generator', function () {
2121
book.should.have.file("gitbook/style.css");
2222
});
2323
});
24+
25+
describe('Custom styles', function() {
26+
var book;
27+
28+
before(function() {
29+
return books.generate("style-print", "ebook")
30+
.then(function(_book) {
31+
book = _book;
32+
});
33+
});
34+
35+
it('should remove default print.css', function() {
36+
var PAGE = fs.readFileSync(
37+
path.join(book.options.output, "index.html"),
38+
{ encoding: "utf-8" }
39+
);
40+
PAGE.should.be.html({
41+
"link": {
42+
count: 1,
43+
attributes: {
44+
href: "./styles/print.css"
45+
}
46+
}
47+
});
48+
});
49+
50+
it('should correctly print.css', function() {
51+
book.should.have.file("styles");
52+
book.should.have.file("styles/print.css");
53+
});
54+
})
2455
});

0 commit comments

Comments
 (0)