File tree 1 file changed +27
-0
lines changed
packages/ember-template-compiler/tests/plugins
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { moduleFor , AbstractTestCase } from 'internal-test-helpers' ;
2
+ import { compile } from '../../index' ;
3
+
4
+ const message = `Illegal use of ...attributes` ;
5
+
6
+ moduleFor (
7
+ 'ember-template-compiler: assert-splattribute-expression' ,
8
+ class extends AbstractTestCase {
9
+ '@test ...attributes is in element space' ( assert ) {
10
+ assert . expect ( 0 ) ;
11
+
12
+ compile ( '<div ...attributes>Foo</div>' ) ;
13
+ }
14
+
15
+ '@test {{...attributes}} is not valid path expression' ( assert ) {
16
+ assert . throws ( ( ) => compile ( '<div>{{...attributes}}</div>' ) , message ) ;
17
+ }
18
+
19
+ '@test {{...attributes}} is not valid modifier' ( assert ) {
20
+ assert . throws ( ( ) => compile ( '<div {{...attributes}}>Wat</div>' , message ) ) ;
21
+ }
22
+
23
+ '@test {{...attributes}} is not valid attribute' ( assert ) {
24
+ assert . throws ( ( ) => compile ( '<div class={{...attributes}}>Wat</div>' , message ) ) ;
25
+ }
26
+ }
27
+ ) ;
You can’t perform that action at this time.
0 commit comments