@@ -77,6 +77,19 @@ test('ComponentRegistry registers and retrieves multiple components', (assert) =
77
77
{ name : 'C6' , component : C6 , generatorFunction : true , isRenderer : false } ) ;
78
78
} ) ;
79
79
80
+ test ( 'ComponentRegistry only detects a renderer function if it has three arguments' , ( assert ) => {
81
+ assert . plan ( 2 ) ;
82
+ const C7 = ( a1 , a2 ) => null ;
83
+ const C8 = ( a1 ) => null ;
84
+ ComponentRegistry . register ( { C7 } ) ;
85
+ ComponentRegistry . register ( { C8 } ) ;
86
+ const components = ComponentRegistry . components ( ) ;
87
+ assert . deepEqual ( components . get ( 'C7' ) ,
88
+ { name : 'C7' , component : C7 , generatorFunction : true , isRenderer : false } ) ;
89
+ assert . deepEqual ( components . get ( 'C8' ) ,
90
+ { name : 'C8' , component : C8 , generatorFunction : true , isRenderer : false } ) ;
91
+ } ) ;
92
+
80
93
test ( 'ComponentRegistry throws error for retrieving unregistered component' , ( assert ) => {
81
94
assert . plan ( 1 ) ;
82
95
assert . throws ( ( ) => ComponentRegistry . get ( 'foobar' ) ,
@@ -87,9 +100,9 @@ test('ComponentRegistry throws error for retrieving unregistered component', (as
87
100
88
101
test ( 'ComponentRegistry throws error for setting null component' , ( assert ) => {
89
102
assert . plan ( 1 ) ;
90
- const C7 = null ;
91
- assert . throws ( ( ) => ComponentRegistry . register ( { C7 } ) ,
92
- / C a l l e d r e g i s t e r w i t h n u l l c o m p o n e n t n a m e d C 7 / ,
103
+ const C9 = null ;
104
+ assert . throws ( ( ) => ComponentRegistry . register ( { C9 } ) ,
105
+ / C a l l e d r e g i s t e r w i t h n u l l c o m p o n e n t n a m e d C 9 / ,
93
106
'Expected an exception for calling ComponentRegistry.set with a null component.'
94
107
) ;
95
108
} ) ;
0 commit comments