@@ -20,53 +20,69 @@ moduleFor(
2020 }
2121
2222 [ '@test it lets the original value through by default' ] ( ) {
23- this . render ( `{{loc "Hiya buddy!"}}` ) ;
23+ expectDeprecation ( ( ) => this . render ( `{{loc "Hiya buddy!"}}` ) , / l o c i s d e p r e c a t e d / ) ;
2424 this . assertText ( 'Hiya buddy!' , 'the unlocalized string is correct' ) ;
2525 runTask ( ( ) => this . rerender ( ) ) ;
2626 this . assertText ( 'Hiya buddy!' , 'the unlocalized string is correct after rerender' ) ;
2727 }
2828
2929 [ '@test it localizes a simple string' ] ( ) {
30- this . render ( `{{loc "Hello Friend"}}` ) ;
30+ expectDeprecation ( ( ) => this . render ( `{{loc "Hello Friend"}}` ) , / l o c i s d e p r e c a t e d / ) ;
3131 this . assertText ( 'Hallo Freund' , 'the localized string is correct' ) ;
3232 runTask ( ( ) => this . rerender ( ) ) ;
3333 this . assertText ( 'Hallo Freund' , 'the localized string is correct after rerender' ) ;
3434 }
3535
3636 [ '@test it takes passed formats into an account' ] ( ) {
37- this . render ( `{{loc "%@, %@" "Hello" "Mr. Pitkin"}}` ) ;
37+ expectDeprecation ( ( ) => {
38+ this . render ( `{{loc "%@, %@" "Hello" "Mr. Pitkin"}}` ) ;
39+ } , / l o c i s d e p r e c a t e d / ) ;
3840 this . assertText ( 'Hello, Mr. Pitkin' , 'the formatted string is correct' ) ;
3941 runTask ( ( ) => this . rerender ( ) ) ;
4042 this . assertText ( 'Hello, Mr. Pitkin' , 'the formatted string is correct after rerender' ) ;
4143 }
4244
4345 [ '@test it updates when bound params change' ] ( ) {
44- this . render ( `{{loc simple}} - {{loc personal 'Mr. Pitkin'}}` , {
45- simple : 'Hello Friend' ,
46- personal : 'Hello' ,
47- } ) ;
48- this . assertText ( 'Hallo Freund - Hallo, Mr. Pitkin' , 'the bound value is correct' ) ;
46+ expectDeprecation ( ( ) => {
47+ this . render ( `{{loc simple}} - {{loc personal 'Mr. Pitkin'}}` , {
48+ simple : 'Hello Friend' ,
49+ personal : 'Hello' ,
50+ } ) ;
51+ this . assertText ( 'Hallo Freund - Hallo, Mr. Pitkin' , 'the bound value is correct' ) ;
52+ } , / l o c i s d e p r e c a t e d / ) ;
4953
5054 runTask ( ( ) => this . rerender ( ) ) ;
5155 this . assertText (
5256 'Hallo Freund - Hallo, Mr. Pitkin' ,
5357 'the bound value is correct after rerender'
5458 ) ;
5559
56- runTask ( ( ) => set ( this . context , 'simple' , "G'day mate" ) ) ;
57- this . assertText ( "G'day mate - Hallo, Mr. Pitkin" , 'the bound value is correct after update' ) ;
60+ expectDeprecation ( ( ) => {
61+ runTask ( ( ) => set ( this . context , 'simple' , "G'day mate" ) ) ;
62+ this . assertText (
63+ "G'day mate - Hallo, Mr. Pitkin" ,
64+ 'the bound value is correct after update'
65+ ) ;
66+ } , / l o c i s d e p r e c a t e d / ) ;
5867
59- runTask ( ( ) => set ( this . context , 'simple' , 'Hello Friend' ) ) ;
60- this . assertText ( 'Hallo Freund - Hallo, Mr. Pitkin' , 'the bound value is correct after reset' ) ;
68+ expectDeprecation ( ( ) => {
69+ runTask ( ( ) => set ( this . context , 'simple' , 'Hello Friend' ) ) ;
70+ this . assertText (
71+ 'Hallo Freund - Hallo, Mr. Pitkin' ,
72+ 'the bound value is correct after reset'
73+ ) ;
74+ } , / l o c i s d e p r e c a t e d / ) ;
6175 }
6276
6377 [ '@test it updates when nested bound params change' ] ( ) {
64- this . render ( `{{loc greetings.simple}} - {{loc greetings.personal 'Mr. Pitkin'}}` , {
65- greetings : {
66- simple : 'Hello Friend' ,
67- personal : 'Hello' ,
68- } ,
69- } ) ;
78+ expectDeprecation ( ( ) => {
79+ this . render ( `{{loc greetings.simple}} - {{loc greetings.personal 'Mr. Pitkin'}}` , {
80+ greetings : {
81+ simple : 'Hello Friend' ,
82+ personal : 'Hello' ,
83+ } ,
84+ } ) ;
85+ } , / l o c i s d e p r e c a t e d / ) ;
7086 this . assertText ( 'Hallo Freund - Hallo, Mr. Pitkin' , 'the bound value is correct' ) ;
7187
7288 runTask ( ( ) => this . rerender ( ) ) ;
@@ -75,22 +91,26 @@ moduleFor(
7591 'the bound value is correct after rerender'
7692 ) ;
7793
78- runTask ( ( ) => set ( this . context , 'greetings.simple' , "G'day mate" ) ) ;
79- this . assertText (
80- "G'day mate - Hallo, Mr. Pitkin" ,
81- 'the bound value is correct after interior mutation'
82- ) ;
94+ expectDeprecation ( ( ) => {
95+ runTask ( ( ) => set ( this . context , 'greetings.simple' , "G'day mate" ) ) ;
96+ this . assertText (
97+ "G'day mate - Hallo, Mr. Pitkin" ,
98+ 'the bound value is correct after interior mutation'
99+ ) ;
100+ } , / l o c i s d e p r e c a t e d / ) ;
83101
84- runTask ( ( ) =>
85- set ( this . context , 'greetings' , {
86- simple : 'Hello Friend' ,
87- personal : 'Hello' ,
88- } )
89- ) ;
90- this . assertText (
91- 'Hallo Freund - Hallo, Mr. Pitkin' ,
92- 'the bound value is correct after replacement'
93- ) ;
102+ expectDeprecation ( ( ) => {
103+ runTask ( ( ) =>
104+ set ( this . context , 'greetings' , {
105+ simple : 'Hello Friend' ,
106+ personal : 'Hello' ,
107+ } )
108+ ) ;
109+ this . assertText (
110+ 'Hallo Freund - Hallo, Mr. Pitkin' ,
111+ 'the bound value is correct after replacement'
112+ ) ;
113+ } , / l o c i s d e p r e c a t e d / ) ;
94114 }
95115
96116 [ '@test it can be overriden' ] ( ) {
0 commit comments