Skip to content

Commit cdeab80

Browse files
committed
add matching underscore test
1 parent 74900ef commit cdeab80

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

test/engine_underscore_tests.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,26 @@ exports['engine_underscore'] = {
8383
// test
8484
test.equals(underscoreEngine.findPartial("<%= _.renderNamedPartial('molecules-details', obj) %>"), 'molecules-details');
8585
test.done();
86+
},
87+
'hidden underscore patterns can be called by their nice names' : function(test){
88+
const util = require('./util/test_utils.js');
89+
90+
//arrange
91+
const testPatternsPath = path.resolve(__dirname, 'files', '_underscore-test-patterns');
92+
const pl = util.fakePatternLab(testPatternsPath);
93+
var pattern_assembler = new pa();
94+
95+
var hiddenPatternPath = path.join('00-atoms', '00-global', '_00-hidden.html');
96+
var hiddenPattern = pattern_assembler.process_pattern_iterative(hiddenPatternPath, pl);
97+
pattern_assembler.process_pattern_recursive(hiddenPatternPath, pl);
98+
99+
var testPatternPath = path.join('00-molecules', '00-global', '00-hidden-pattern-tester.html');
100+
var testPattern = pattern_assembler.process_pattern_iterative(testPatternPath, pl);
101+
pattern_assembler.process_pattern_recursive(testPatternPath, pl);
102+
103+
//act
104+
test.equals(testPattern.render(), 'Here\'s the hidden atom: [I\'m the hidden atom\n]\n');
105+
test.done();
86106
}
87107
};
88108

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
I'm the hidden atom
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Here's the hidden atom: [<%=_.renderNamedPartial('atoms-hidden', obj)%>]

0 commit comments

Comments
 (0)