Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pagedjs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Guillaume
pagedjs
Commits
0f14c97b
Commit
0f14c97b
authored
Jun 07, 2020
by
Nellie McKesson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding spec file
parent
09148961
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
193 additions
and
1 deletion
+193
-1
nth-of-type-selector-spec-js-nth-of-type-selector-should-create-a-pdf-1-snap.png
...ec-js-nth-of-type-selector-should-create-a-pdf-1-snap.png
+0
-0
nth-of-type-selector-spec-js-nth-of-type-selector-should-create-a-pdf-2-snap.png
...ec-js-nth-of-type-selector-should-create-a-pdf-2-snap.png
+0
-0
nth-of-type-selector.html
specs/nth-of-type-selector/nth-of-type-selector.html
+157
-0
nth-of-type-selector.spec.js
specs/nth-of-type-selector/nth-of-type-selector.spec.js
+35
-0
nth-of-type.js
src/modules/paged-media/nth-of-type.js
+1
-1
No files found.
specs/nth-of-type-selector/__image_snapshots_mac__/nth-of-type-selector-spec-js-nth-of-type-selector-should-create-a-pdf-1-snap.png
0 → 100644
View file @
0f14c97b
132 KB
specs/nth-of-type-selector/__image_snapshots_mac__/nth-of-type-selector-spec-js-nth-of-type-selector-should-create-a-pdf-2-snap.png
0 → 100644
View file @
0f14c97b
120 KB
specs/nth-of-type-selector/nth-of-type-selector.html
0 → 100644
View file @
0f14c97b
This diff is collapsed.
Click to expand it.
specs/nth-of-type-selector/nth-of-type-selector.spec.js
0 → 100644
View file @
0f14c97b
const
TIMEOUT
=
10000
;
// Some book might take longer than this to renderer
describe
(
"
nth-of-type-selector
"
,
()
=>
{
let
page
;
beforeAll
(
async
()
=>
{
page
=
await
loadPage
(
"
nth-of-type-selector/nth-of-type-selector.html
"
);
return
page
.
rendered
;
},
TIMEOUT
);
afterAll
(
async
()
=>
{
if
(
!
DEBUG
)
{
await
page
.
close
();
}
});
it
(
"
should render text
"
,
async
()
=>
{
let
text
=
await
page
.
evaluate
(()
=>
document
.
body
.
textContent
);
expect
(
text
).
toContain
(
"
Chapter 1. Loomings.
"
);
});
it
(
"
should render 14 pages
"
,
async
()
=>
{
let
pages
=
await
page
.
$$eval
(
"
.pagedjs_page
"
,
(
r
)
=>
r
.
length
);
expect
(
pages
).
toBe
(
14
);
});
if
(
!
DEBUG
)
{
it
(
"
should create a pdf
"
,
async
()
=>
{
let
pdf
=
await
page
.
pdf
(
PDF_SETTINGS
);
expect
(
pdf
).
toMatchPDFSnapshot
(
1
);
expect
(
pdf
).
toMatchPDFSnapshot
(
2
);
});
}
}
);
src/modules/paged-media/nth-of-type.js
View file @
0f14c97b
...
...
@@ -13,7 +13,7 @@ class NthOfType extends Handler {
onRule
(
ruleNode
,
ruleItem
,
rulelist
)
{
let
selector
=
csstree
.
generate
(
ruleNode
.
prelude
);
if
(
selector
.
match
(
/:
(
first|last|nth
)
-of-type/
))
{
console
.
log
(
rule
Node
);
console
.
log
(
rule
Item
);
console
.
log
(
selector
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment