Skip to content

Commit 8e8776b

Browse files
committed
Update unit-tests about components.
1 parent f89f2c7 commit 8e8776b

6 files changed

Lines changed: 26 additions & 1 deletion

File tree

test/components/contactform.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
body { color: red; }
33
</style>
44

5-
@(Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptate, quo.) @{json(model)}
5+
COMPONENTVIEW@{settings.value}
66

77
<script type="text/javascript">
88
var a = 0;

test/components/contactform.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
exports.install = function() {
2+
F.route('/components/contactform/', function() {
3+
this.plain('CONTACTFORM COMPONENTS');
4+
});
5+
};

test/controllers/default.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ function viewViews() {
525525
//self.framework.stop();
526526
//return;
527527

528+
assert.ok(output.contains('#COMPONENTVIEWPETER#'), name + 'components rendering');
528529
assert.ok(output.contains('#<div>@{{ vue_command }}</div>#'), name + 'VUE command');
529530
assert.ok(output.contains('#mobilefalse#'), name + 'mobile');
530531
assert.ok(output.contains('<count>10</count>'), name + 'inline helper');

test/test-framework-debug.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,15 @@ function test_routing(next) {
619619
});
620620
});
621621

622+
async.await('components routing', function(complete) {
623+
utils.request(url + 'components/contactform/', ['get'], function(error, data, code, headers) {
624+
if (error)
625+
throw error;
626+
assert(data === 'CONTACTFORM COMPONENTS', 'components: routing');
627+
complete();
628+
});
629+
});
630+
622631
async.await('static-file-notfound-because-directory1', function(complete) {
623632
utils.request(url + 'directory.txt', [], function(error, data, code, headers) {
624633
if (error)

test/test-framework-release.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,15 @@ function test_routing(next) {
619619
});
620620
});
621621

622+
async.await('components routing', function(complete) {
623+
utils.request(url + 'components/contactform/', ['get'], function(error, data, code, headers) {
624+
if (error)
625+
throw error;
626+
assert(data === 'CONTACTFORM COMPONENTS', 'components: routing');
627+
complete();
628+
});
629+
});
630+
622631
async.await('static-file-notfound-because-directory1', function(complete) {
623632
utils.request(url + 'directory.txt', [], function(error, data, code, headers) {
624633
if (error)

test/views/a.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
@{endif}
1010
@{end}
1111

12+
#@{component('contactform', { value: 'PETER' })}#
1213
#<div>@{{ vue_command }}</div>#
1314
@{name(10)}
1415
@{meta('TITLE')}

0 commit comments

Comments
 (0)