@ -1183,7 +1183,103 @@ describe("QuestionSheet component", () => {
expect ( longBtn . style . minHeight ) . toBe ( "" ) ;
} ) ;
} ) ;
it ( "renders exact 6 political stance options and NOT countries for real DB question beliefs_lifestyle.political_stance_towards_governance (FA & EN)" , async ( ) = > {
const { useI18n } = await import ( "@/translations/provider" ) ;
( useI18n as any ) . mockReturnValue ( {
locale : "fa" ,
dictionary : { Confirm : "تایید" } ,
} ) ;
const politicalQuestionFa : QuestionField = {
id : "beliefs_lifestyle.political_stance_towards_governance" ,
title : "موضع کلی شما نسبت به حکومت مستقر در کشور محل زندگیتان چیست؟" ,
type : "dropdown" ,
order : 10 ,
required : false ,
baseRequired : false ,
isVisible : true ,
private : true ,
description : "" ,
tooltip : "این سؤال محرمانه است و فقط برای سنجش سازگاری ارزشی استفاده میشود." ,
ui_config : {
private : true ,
noSearch : false ,
placeholder_en : "Select one option" ,
placeholder_fa : "یک گزینه را انتخاب کنید" ,
} ,
extras : {
placeHolder : "یک گزینه را انتخاب کنید" ,
range : [ 0 , 0 ] ,
options : [ ] ,
noSearch : false ,
} ,
options : [
{
id : "beliefs_lifestyle.political_stance_towards_governance.strongly_supportive" ,
value : "strongly_supportive" ,
label : "قویاً موافق و حامی هستم" ,
order : 1 ,
} ,
{
id : "beliefs_lifestyle.political_stance_towards_governance.generally_supportive_with_critiques" ,
value : "generally_supportive_with_critiques" ,
label : "در مجموع موافقم، اما نقدهای مشخصی دارم" ,
order : 2 ,
} ,
{
id : "beliefs_lifestyle.political_stance_towards_governance.mixed_or_moderate_view" ,
value : "mixed_or_moderate_view" ,
label : "دیدگاه ترکیبی یا میانه دارم" ,
order : 3 ,
} ,
{
id : "beliefs_lifestyle.political_stance_towards_governance.generally_critical" ,
value : "generally_critical" ,
label : "در مجموع منتقد هستم" ,
order : 4 ,
} ,
{
id : "beliefs_lifestyle.political_stance_towards_governance.strongly_opposed" ,
value : "strongly_opposed" ,
label : "قویاً مخالف هستم" ,
order : 5 ,
} ,
{
id : "beliefs_lifestyle.political_stance_towards_governance.no_political_interest_or_stance" ,
value : "no_political_interest_or_stance" ,
label : "علاقه یا موضع سیاسی مشخصی ندارم" ,
order : 6 ,
} ,
] ,
} ;
render (
< QueryClientProvider client = { queryClient } >
< QuestionAnswersProvider slug = "beliefs_lifestyle" questions = { [ politicalQuestionFa ] } >
< QuestionSheet question = { politicalQuestionFa } / >
< / QuestionAnswersProvider >
< / QueryClientProvider > ,
) ;
fireEvent . click ( screen . getByRole ( "button" , { name : "یک گزینه را انتخاب کنید" } ) ) ;
// Should render all 6 political stance options
expect ( screen . getByRole ( "button" , { name : "قویاً موافق و حامی هستم" } ) ) . toBeDefined ( ) ;
expect ( screen . getByRole ( "button" , { name : "در مجموع موافقم، اما نقدهای مشخصی دارم" } ) ) . toBeDefined ( ) ;
expect ( screen . getByRole ( "button" , { name : "دیدگاه ترکیبی یا میانه دارم" } ) ) . toBeDefined ( ) ;
expect ( screen . getByRole ( "button" , { name : "در مجموع منتقد هستم" } ) ) . toBeDefined ( ) ;
expect ( screen . getByRole ( "button" , { name : "قویاً مخالف هستم" } ) ) . toBeDefined ( ) ;
expect ( screen . getByRole ( "button" , { name : "علاقه یا موضع سیاسی مشخصی ندارم" } ) ) . toBeDefined ( ) ;
// Should NOT render countries or search bar (compact 6-option sheet)
expect ( screen . queryByRole ( "button" , { name : "افغانستان" } ) ) . toBeNull ( ) ;
expect ( screen . queryByRole ( "button" , { name : "ایران" } ) ) . toBeNull ( ) ;
expect ( screen . queryByRole ( "button" , { name : "Afghanistan" } ) ) . toBeNull ( ) ;
expect ( screen . queryByPlaceholderText ( "جستجو..." ) ) . toBeNull ( ) ;
} ) ;
} ) ;