Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
patternlibrary
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
js
patternlibrary
Commits
77e039c8
Commit
77e039c8
authored
Mar 20, 2018
by
Björn Bartels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PATLAB-7
update helper, config and templating tests
parent
d7ce4d84
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
230 additions
and
10 deletions
+230
-10
index.html
...tures.staticpages/helper-code-default/expected/index.html
+14
-0
patternlibrary.json
...pages/helper-code-default/expected/pl/patternlibrary.json
+4
-0
default.html
...ures.staticpages/helper-code-default/layouts/default.html
+5
-0
index.html
...fixtures.staticpages/helper-code-default/pages/index.html
+12
-0
test.01.init-config.js
test/test.01.init-config.js
+13
-0
test.10.basic-templating.js
test/test.10.basic-templating.js
+17
-0
test.90.handlebars.js
test/test.90.handlebars.js
+165
-10
No files found.
test/fixtures.staticpages/helper-code-default/expected/index.html
0 → 100644
View file @
77e039c8
<html>
<body>
<div
class=
"code-example"
><pre><code
class=
"html"
><span
class=
"hljs-tag"
>
<
<span
class=
"hljs-name"
>
section
</span>
<span
class=
"hljs-attr"
>
class
</span>
=
<span
class=
"hljs-string"
>
"galaxy"
</span>
>
</span>
<span
class=
"hljs-tag"
>
<
<span
class=
"hljs-name"
>
div
</span>
<span
class=
"hljs-attr"
>
class
</span>
=
<span
class=
"hljs-string"
>
"planet"
</span>
>
</span>
<span
class=
"hljs-tag"
>
<
<span
class=
"hljs-name"
>
h1
</span>
<span
class=
"hljs-attr"
>
id
</span>
=
<span
class=
"hljs-string"
>
"earth"
</span>
>
</span>
some markup...
<span
class=
"hljs-tag"
>
<
/
<span
class=
"hljs-name"
>
h1
</span>
>
</span>
<span
class=
"hljs-tag"
>
<
/
<span
class=
"hljs-name"
>
div
</span>
>
</span>
<span
class=
"hljs-tag"
>
<
<span
class=
"hljs-name"
>
span
</span>
<span
class=
"hljs-attr"
>
id
</span>
=
<span
class=
"hljs-string"
>
"sun"
</span>
>
</span>
more markup...
<span
class=
"hljs-tag"
>
<
/
<span
class=
"hljs-name"
>
span
</span>
>
</span>
<span
class=
"hljs-tag"
>
<
/
<span
class=
"hljs-name"
>
section
</span>
>
</span>
</code></pre></div>
</body>
</html>
test/fixtures.staticpages/helper-code-default/expected/pl/patternlibrary.json
0 → 100644
View file @
77e039c8
{
"patterns"
:
{},
"categories"
:
[]
}
test/fixtures.staticpages/helper-code-default/layouts/default.html
0 → 100644
View file @
77e039c8
<html>
<body>
{{> body}}
</body>
</html>
test/fixtures.staticpages/helper-code-default/pages/index.html
0 → 100644
View file @
77e039c8
{{#code}}
<section
class=
"galaxy"
>
<div
class=
"planet"
>
<h1
id=
"earth"
>
some markup...
</h1>
</div>
<span
id=
"sun"
>
more markup...
</span>
</section>
{{/code}}
test/test.01.init-config.js
View file @
77e039c8
...
...
@@ -227,5 +227,18 @@ describe('Patternlibrary instanciation and configuration:', function() {
});
describe
(
'Patternlibrary.reset()'
,
function
()
{
it
(
'should clear all pattern-, category- and user data'
,
function
()
{
var
p
=
new
Patternlibrary
.
Patternlibrary
();
p
.
data
.
someKey
=
'some value'
;
p
.
reset
();
expect
(
p
.
data
).
not
.
to
.
have
.
a
.
key
(
'someKey'
);
expect
(
p
.
data
.
patterns
).
to
.
be
.
a
(
'object'
);
expect
(
p
.
data
.
categories
).
to
.
be
.
a
(
'object'
);
expect
(
Object
.
keys
(
p
.
data
.
patterns
).
length
).
to
.
equal
(
0
);
expect
(
Object
.
keys
(
p
.
data
.
categories
).
length
).
to
.
equal
(
0
);
});
});
});
test/test.10.basic-templating.js
View file @
77e039c8
...
...
@@ -10,6 +10,23 @@ const CLEAN_UP = !true;
describe
(
'Patternlibrary basic templating:'
,
function
()
{
describe
(
'Patternlibrary.layout'
,
function
()
{
it
(
'retrieves the default GUI layout if none is set (yet)'
,
function
(){
var
p
=
new
Patternlibrary
.
Patternlibrary
();
var
layout
=
p
.
layout
;
expect
(
p
.
layout
).
to
.
be
.
a
(
'function'
);
expect
(
layout
).
to
.
be
.
a
(
'function'
);
p
.
handlebars
.
registerPartial
(
'docs-htmlhead'
,
'<head>'
);
p
.
handlebars
.
registerPartial
(
'body'
,
'<body>'
);
p
.
handlebars
.
registerPartial
(
'docs-htmlclose'
,
'<close>'
);
var
rendered
=
layout
({});
expect
(
rendered
).
to
.
contain
(
'<head>'
);
expect
(
rendered
).
to
.
contain
(
'<body>'
);
expect
(
rendered
).
to
.
contain
(
'<close>'
);
});
it
(
'assings a handlebars default layout "{{> body}}" from an empty template name string'
,
function
()
{
var
p
=
new
Patternlibrary
.
Patternlibrary
();
...
...
test/test.90.handlebars.js
View file @
77e039c8
This diff is collapsed.
Click to expand it.
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