99 AppBridge ,
1010 DashboardEventFactory ,
1111 DispatchResponseEvent ,
12+ FormPayloadProductEdit ,
13+ FormPayloadProductTranslate ,
1214 HandshakeEvent ,
1315 ThemeEvent ,
1416} from "." ;
@@ -330,7 +332,7 @@ describe("AppBridge", () => {
330332 it ( "Updates state with form context when form payload event is received" , ( ) => {
331333 expect ( appBridge . getState ( ) . formContext ) . toEqual ( { } ) ;
332334
333- const formPayload = {
335+ const formPayload : FormPayloadProductTranslate = {
334336 form : "product-translate" as const ,
335337 productId : "product-123" ,
336338 translationLanguage : "es" ,
@@ -343,6 +345,27 @@ describe("AppBridge", () => {
343345 currentValue : "Original Product" ,
344346 type : "short-text" as const ,
345347 } ,
348+ productDescription : {
349+ fieldName : "" ,
350+ originalValue : "" ,
351+ translatedValue : "" ,
352+ currentValue : "" ,
353+ type : "short-text" ,
354+ } ,
355+ seoName : {
356+ fieldName : "" ,
357+ originalValue : "" ,
358+ translatedValue : "" ,
359+ currentValue : "" ,
360+ type : "short-text" ,
361+ } ,
362+ seoDescription : {
363+ fieldName : "" ,
364+ originalValue : "" ,
365+ translatedValue : "" ,
366+ currentValue : "" ,
367+ type : "short-text" ,
368+ } ,
346369 } ,
347370 } ;
348371
@@ -373,7 +396,7 @@ describe("AppBridge", () => {
373396
374397 expect ( callback ) . not . toHaveBeenCalled ( ) ;
375398
376- const formPayload = {
399+ const formPayload : FormPayloadProductTranslate = {
377400 form : "product-translate" as const ,
378401 productId : "product-456" ,
379402 translationLanguage : "fr" ,
@@ -386,6 +409,27 @@ describe("AppBridge", () => {
386409 currentValue : "Description" ,
387410 type : "editorjs" as const ,
388411 } ,
412+ productName : {
413+ fieldName : "" ,
414+ originalValue : "" ,
415+ translatedValue : "" ,
416+ currentValue : "" ,
417+ type : "short-text" ,
418+ } ,
419+ seoName : {
420+ fieldName : "" ,
421+ originalValue : "" ,
422+ translatedValue : "" ,
423+ currentValue : "" ,
424+ type : "short-text" ,
425+ } ,
426+ seoDescription : {
427+ fieldName : "" ,
428+ originalValue : "" ,
429+ translatedValue : "" ,
430+ currentValue : "" ,
431+ type : "short-text" ,
432+ } ,
389433 } ,
390434 } ;
391435
@@ -435,7 +479,7 @@ describe("AppBridge", () => {
435479 } ) ;
436480
437481 it ( "Updates form context with new fields when multiple form events are received" , ( ) => {
438- const firstFormPayload = {
482+ const firstFormPayload : FormPayloadProductTranslate = {
439483 form : "product-translate" as const ,
440484 productId : "product-1" ,
441485 translationLanguage : "es" ,
@@ -448,6 +492,27 @@ describe("AppBridge", () => {
448492 currentValue : "Product 1" ,
449493 type : "short-text" as const ,
450494 } ,
495+ productDescription : {
496+ fieldName : "" ,
497+ originalValue : "" ,
498+ translatedValue : "" ,
499+ currentValue : "" ,
500+ type : "short-text" ,
501+ } ,
502+ seoName : {
503+ fieldName : "" ,
504+ originalValue : "" ,
505+ translatedValue : "" ,
506+ currentValue : "" ,
507+ type : "short-text" ,
508+ } ,
509+ seoDescription : {
510+ fieldName : "" ,
511+ originalValue : "" ,
512+ translatedValue : "" ,
513+ currentValue : "" ,
514+ type : "short-text" ,
515+ } ,
451516 } ,
452517 } ;
453518
@@ -461,7 +526,7 @@ describe("AppBridge", () => {
461526
462527 expect ( appBridge . getState ( ) . formContext ?. [ "product-translate" ] ?. productId ) . toBe ( "product-1" ) ;
463528
464- const secondFormPayload = {
529+ const secondFormPayload : FormPayloadProductTranslate = {
465530 form : "product-translate" as const ,
466531 productId : "product-2" ,
467532 translationLanguage : "fr" ,
@@ -474,6 +539,27 @@ describe("AppBridge", () => {
474539 currentValue : "Product 2" ,
475540 type : "short-text" as const ,
476541 } ,
542+ productDescription : {
543+ fieldName : "" ,
544+ originalValue : "" ,
545+ translatedValue : "" ,
546+ currentValue : "" ,
547+ type : "short-text" ,
548+ } ,
549+ seoName : {
550+ fieldName : "" ,
551+ originalValue : "" ,
552+ translatedValue : "" ,
553+ currentValue : "" ,
554+ type : "short-text" ,
555+ } ,
556+ seoDescription : {
557+ fieldName : "" ,
558+ originalValue : "" ,
559+ translatedValue : "" ,
560+ currentValue : "" ,
561+ type : "short-text" ,
562+ } ,
477563 } ,
478564 } ;
479565
@@ -497,7 +583,7 @@ describe("AppBridge", () => {
497583 it ( "Stores multiple form contexts for different form types simultaneously" , ( ) => {
498584 expect ( appBridge . getState ( ) . formContext ) . toEqual ( { } ) ;
499585
500- const productTranslatePayload = {
586+ const productTranslatePayload : FormPayloadProductTranslate = {
501587 form : "product-translate" as const ,
502588 productId : "product-123" ,
503589 translationLanguage : "es" ,
@@ -510,10 +596,31 @@ describe("AppBridge", () => {
510596 currentValue : "Original Product" ,
511597 type : "short-text" as const ,
512598 } ,
599+ productDescription : {
600+ fieldName : "" ,
601+ originalValue : "" ,
602+ translatedValue : "" ,
603+ currentValue : "" ,
604+ type : "editorjs" ,
605+ } ,
606+ seoName : {
607+ fieldName : "" ,
608+ originalValue : "" ,
609+ translatedValue : "" ,
610+ currentValue : "" ,
611+ type : "short-text" ,
612+ } ,
613+ seoDescription : {
614+ fieldName : "" ,
615+ originalValue : "" ,
616+ translatedValue : "" ,
617+ currentValue : "" ,
618+ type : "editorjs" ,
619+ } ,
513620 } ,
514621 } ;
515622
516- const productEditPayload = {
623+ const productEditPayload : FormPayloadProductEdit = {
517624 form : "product-edit" as const ,
518625 productId : "product-456" ,
519626 fields : {
0 commit comments