@@ -576,30 +576,30 @@ describe('Dashboard Factory', () => {
576576} ) ;
577577
578578describe ( 'Dashboard I18n Integration' , ( ) => {
579- it ( 'should accept i18n object as dashboard label' , ( ) => {
579+ it ( 'should reject i18n object as dashboard label' , ( ) => {
580580 expect ( ( ) => DashboardSchema . parse ( {
581581 name : 'i18n_dashboard' ,
582582 label : { key : 'dashboards.sales' , defaultValue : 'Sales Dashboard' } ,
583583 widgets : [ ] ,
584- } ) ) . not . toThrow ( ) ;
584+ } ) ) . toThrow ( ) ;
585585 } ) ;
586- it ( 'should accept i18n object as dashboard description' , ( ) => {
586+ it ( 'should reject i18n object as dashboard description' , ( ) => {
587587 expect ( ( ) => DashboardSchema . parse ( {
588588 name : 'test_dashboard' ,
589589 label : 'Test' ,
590590 description : { key : 'dashboards.test.desc' , defaultValue : 'Test dashboard' } ,
591591 widgets : [ ] ,
592- } ) ) . not . toThrow ( ) ;
592+ } ) ) . toThrow ( ) ;
593593 } ) ;
594- it ( 'should accept i18n object as widget title' , ( ) => {
594+ it ( 'should reject i18n object as widget title' , ( ) => {
595595 expect ( ( ) => DashboardWidgetSchema . parse ( {
596596 id : 'total_revenue' ,
597597 title : { key : 'widgets.revenue' , defaultValue : 'Total Revenue' } ,
598598 type : 'metric' ,
599599 layout : { x : 0 , y : 0 , w : 3 , h : 2 } ,
600- } ) ) . not . toThrow ( ) ;
600+ } ) ) . toThrow ( ) ;
601601 } ) ;
602- it ( 'should accept i18n object in global filter label' , ( ) => {
602+ it ( 'should reject i18n object in global filter label' , ( ) => {
603603 expect ( ( ) => DashboardSchema . parse ( {
604604 name : 'filter_dash' ,
605605 label : 'Filtered' ,
@@ -609,7 +609,7 @@ describe('Dashboard I18n Integration', () => {
609609 label : { key : 'filters.status' , defaultValue : 'Status' } ,
610610 type : 'select' ,
611611 } ] ,
612- } ) ) . not . toThrow ( ) ;
612+ } ) ) . toThrow ( ) ;
613613 } ) ;
614614} ) ;
615615
@@ -783,15 +783,14 @@ describe('DashboardWidgetSchema - description', () => {
783783 expect ( result . description ) . toBe ( 'Year-to-date total revenue' ) ;
784784 } ) ;
785785
786- it ( 'should accept widget with i18n description' , ( ) => {
787- const result = DashboardWidgetSchema . parse ( {
786+ it ( 'should reject widget with i18n description' , ( ) => {
787+ expect ( ( ) => DashboardWidgetSchema . parse ( {
788788 id : 'revenue_i18n' ,
789789 title : 'Revenue' ,
790790 description : { key : 'widgets.revenue.desc' , defaultValue : 'Total revenue' } ,
791791 type : 'metric' ,
792792 layout : { x : 0 , y : 0 , w : 3 , h : 2 } ,
793- } ) ;
794- expect ( result . description ) . toEqual ( { key : 'widgets.revenue.desc' , defaultValue : 'Total revenue' } ) ;
793+ } ) ) . toThrow ( ) ;
795794 } ) ;
796795
797796 it ( 'should accept widget without description (optional)' , ( ) => {
@@ -1043,15 +1042,14 @@ describe('GlobalFilterSchema', () => {
10431042 expect ( result . options ! [ 0 ] . label ) . toBe ( 'High' ) ;
10441043 } ) ;
10451044
1046- it ( 'should accept filter with i18n option labels' , ( ) => {
1047- const result = GlobalFilterSchema . parse ( {
1045+ it ( 'should reject filter with i18n option labels' , ( ) => {
1046+ expect ( ( ) => GlobalFilterSchema . parse ( {
10481047 field : 'priority' ,
10491048 type : 'select' ,
10501049 options : [
10511050 { value : 'high' , label : { key : 'filter.priority.high' , defaultValue : 'High' } } ,
10521051 ] ,
1053- } ) ;
1054- expect ( result . options ! [ 0 ] . label ) . toEqual ( { key : 'filter.priority.high' , defaultValue : 'High' } ) ;
1052+ } ) ) . toThrow ( ) ;
10551053 } ) ;
10561054
10571055 it ( 'should accept filter with optionsFrom (dynamic binding)' , ( ) => {
@@ -1295,12 +1293,11 @@ describe('DashboardHeaderActionSchema', () => {
12951293 expect ( result . icon ) . toBe ( 'play' ) ;
12961294 } ) ;
12971295
1298- it ( 'should accept i18n label' , ( ) => {
1299- const result = DashboardHeaderActionSchema . parse ( {
1296+ it ( 'should reject i18n label' , ( ) => {
1297+ expect ( ( ) => DashboardHeaderActionSchema . parse ( {
13001298 label : { key : 'actions.export' , defaultValue : 'Export' } ,
13011299 actionUrl : '/export' ,
1302- } ) ;
1303- expect ( result . label ) . toEqual ( { key : 'actions.export' , defaultValue : 'Export' } ) ;
1300+ } ) ) . toThrow ( ) ;
13041301 } ) ;
13051302
13061303 it ( 'should reject action without required fields' , ( ) => {
@@ -1429,13 +1426,12 @@ describe('WidgetMeasureSchema', () => {
14291426 expect ( result . format ) . toBe ( '$0,0.00' ) ;
14301427 } ) ;
14311428
1432- it ( 'should accept measure with i18n label' , ( ) => {
1433- const result = WidgetMeasureSchema . parse ( {
1429+ it ( 'should reject measure with i18n label' , ( ) => {
1430+ expect ( ( ) => WidgetMeasureSchema . parse ( {
14341431 valueField : 'quantity' ,
14351432 aggregate : 'avg' ,
14361433 label : { key : 'measures.avg_qty' , defaultValue : 'Average Quantity' } ,
1437- } ) ;
1438- expect ( result . label ) . toEqual ( { key : 'measures.avg_qty' , defaultValue : 'Average Quantity' } ) ;
1434+ } ) ) . toThrow ( ) ;
14391435 } ) ;
14401436
14411437 it ( 'should accept all aggregate functions' , ( ) => {
0 commit comments