Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

145 test #307

Merged
merged 33 commits into from
Apr 12, 2016
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0343df1
more accurate paramToJson in parameter_hunter
Mar 16, 2016
92e9a00
updating unit tests for parameter_hunter paramToJson
Mar 16, 2016
695471c
minor edit
Mar 16, 2016
8b3551f
another param string parser
Mar 17, 2016
77a2089
bugs fixed, unit tests working
Mar 18, 2016
e3bb31e
variable name change
Mar 18, 2016
df0e804
Added (failing for now) test to highlight the bug.
Mar 11, 2016
695a936
Added another test for another bug (parenthesis in value confuses pat…
Mar 11, 2016
2a297f4
Added additional parameter hunter tests.
Mar 14, 2016
c8acb5a
replacing JSON with JSON5 for better error messaging
Mar 18, 2016
9348441
working paramToJson
Mar 18, 2016
cf080af
stricter unit tests
Mar 18, 2016
68a6c35
comment updates
Mar 18, 2016
37ad825
simplfying paramToJson further
Mar 18, 2016
a7e52cd
simplfying paramToJson further
Mar 18, 2016
f3ee0f1
comment update
Mar 18, 2016
db17e81
tightened parameter key search
Mar 18, 2016
83f6a4f
comment update
Mar 18, 2016
ed13128
accommodating decimals and exponentials as valid numeric values
Mar 18, 2016
7bcea0a
comment update
Mar 18, 2016
2317cae
fixing array instead of number typo
Mar 18, 2016
3583251
more comments
Mar 18, 2016
704346a
spacing to pass eslint
Mar 18, 2016
a0d33d3
removing unnecessary escape
Mar 19, 2016
baee73b
Fixed minor bug: Array instead of int used as substring() arg.
Mar 21, 2016
7044fc8
Added parameter_hunter test to explicity show that issue #145 will no…
Mar 21, 2016
4690f79
fixing substring param typo
Mar 29, 2016
eedaecc
renaming json5 instances
Mar 29, 2016
7fa7f6b
comment update
Mar 29, 2016
3f7d984
Merge branch 'dev' of github.com:pattern-lab/patternlab-node into 250…
Apr 6, 2016
a346f40
Merge branch '250-precursor' into 250-precursor-fixes
Apr 8, 2016
956be89
Merge branch 'dev' into 250-precursor-fixes
Apr 11, 2016
7362cce
Added comment in test code to reference issue #145
Apr 11, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions test/parameter_hunter_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,25 @@
parameter_hunter.find_parameters(currentPattern, patternlab);
test.equals(currentPattern.extendedTemplate, '<p></p>');

test.done();
},

'parameter hunter parses parameters containing html tags' : function(test){
// From issue #145 https://github.com/pattern-lab/patternlab-node/issues/145
var currentPattern = currentPatternClosure();
var patternlab = patternlabClosure();
var parameter_hunter = new ph();

patternlab.patterns[0].template = "<p>{{{ tag1 }}}</p><p>{{{ tag2 }}}</p><p>{{{ tag3 }}}</p>";
patternlab.patterns[0].extendedTemplate = patternlab.patterns[0].template;

currentPattern.template = "{{> molecules-single-comment(tag1: '<strong>Single-quoted</strong>', tag2: \"<em>Double-quoted</em>\", tag3: '<strong class=\\\"foo\\\" id=\\\'bar\\\'>With attributes</strong>') }}";
currentPattern.extendedTemplate = currentPattern.template;
currentPattern.parameteredPartials[0] = currentPattern.template;

parameter_hunter.find_parameters(currentPattern, patternlab);
test.equals(currentPattern.extendedTemplate, '<p><strong>Single-quoted</strong></p><p><em>Double-quoted</em></p><p><strong class="foo" id=\'bar\'>With attributes</strong></p>');

test.done();
}

Expand Down