You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✅Added new tests for email encoding related to i18n (#23145)
ref #23121
* Added additional tests to cover the newly-translated paywall and bugfix.
* Apostrophes in strings are worth explicitly testing, because double-encoding is too easy to do.
it('correctly include the site name in the paywall (in French)',asyncfunction(){
2799
+
renderedPost='<div> Lexical Test </div> <div data-gh-segment="status:-free"> members only section</div> some text for both <!--members-only--> finishing part only for members';
2800
+
letpost={
2801
+
related: ()=>{
2802
+
returnnull;
2803
+
},
2804
+
get: (key)=>{
2805
+
if(key==='lexical'){
2806
+
return'{}';
2807
+
}
2808
+
2809
+
if(key==='visibility'){
2810
+
return'paid';
2811
+
}
2812
+
2813
+
if(key==='title'){
2814
+
return'Test Post';
2815
+
}
2816
+
},
2817
+
getLazyRelation: ()=>{
2818
+
return{
2819
+
models: [{
2820
+
get: (key)=>{
2821
+
if(key==='name'){
2822
+
return'Test Author';
2823
+
}
2824
+
}
2825
+
}]
2826
+
};
2827
+
}
2828
+
};
2829
+
letnewsletter={
2830
+
get: (key)=>{
2831
+
if(key==='header_image'){
2832
+
returnnull;
2833
+
}
2834
+
2835
+
if(key==='name'){
2836
+
return'Test Newsletter';
2837
+
}
2838
+
2839
+
if(key==='badge'){
2840
+
returnfalse;
2841
+
}
2842
+
2843
+
if(key==='feedback_enabled'){
2844
+
returntrue;
2845
+
}
2846
+
2847
+
if(key==='show_post_title_section'){
2848
+
returntrue;
2849
+
}
2850
+
2851
+
returnfalse;
2852
+
}
2853
+
};
2854
+
letoptions={};
2855
+
2856
+
letresponse=awaitemailRenderer.renderBody(
2857
+
post,
2858
+
newsletter,
2859
+
'status:free',
2860
+
options
2861
+
);
2862
+
2863
+
response.html.should.not.containEql('members only section');
2864
+
response.html.should.containEql('some text for both');
2865
+
response.html.should.not.containEql('finishing part only for members');
2866
+
response.html.should.containEql('Devenez un abonné payant de Cathy's Blog pour accéder à du contenu exclusif');
2867
+
response.plaintext.should.containEql('Devenez un abonné payant de Cathy\'s Blog pour accéder à du contenu exclusif');
0 commit comments