@@ -3620,6 +3620,7 @@ describe('Localization', () => {
36203620 id : draft . id ,
36213621 collection : allFieldsLocalizedSlug ,
36223622 data : {
3623+ text : 'Published english' ,
36233624 _status : 'published' ,
36243625 } ,
36253626 locale : 'en' ,
@@ -3633,7 +3634,6 @@ describe('Localization', () => {
36333634 draft : true ,
36343635 } )
36353636
3636- console . log ( updatedMainDoc )
36373637 expect ( updatedMainDoc . _localizedMeta . en . status ) . toEqual ( 'published' )
36383638 expect ( updatedMainDoc . _localizedMeta . es . status ) . toEqual ( 'draft' )
36393639
@@ -3655,6 +3655,7 @@ describe('Localization', () => {
36553655 } ,
36563656 locale : 'en' ,
36573657 } )
3658+
36583659 expect ( publishedStatusQuery . docs ) . toHaveLength ( 1 )
36593660
36603661 const draftStatusQuery = await payload . find ( {
@@ -3665,10 +3666,10 @@ describe('Localization', () => {
36653666 } ,
36663667 } ,
36673668 locale : 'es' ,
3669+ draft : true ,
36683670 } )
3669- expect ( draftStatusQuery . docs ) . toHaveLength (
3670- ( payload . config . localization as LocalizationConfig ) . locales . length - 1 ,
3671- )
3671+
3672+ expect ( draftStatusQuery . docs ) . toHaveLength ( 1 )
36723673 } )
36733674 } )
36743675
@@ -3710,7 +3711,7 @@ describe('Localization', () => {
37103711 draft : false ,
37113712 } )
37123713 expect ( updatedMainDoc . _localizedMeta . en . status ) . toEqual ( 'draft' )
3713- expect ( updatedMainDoc . _localizedMeta . es . status ) . toEqual ( 'draft ' )
3714+ expect ( updatedMainDoc . _localizedMeta . es . status ) . toEqual ( 'published ' )
37143715 } )
37153716
37163717 it ( 'should unpublish specific locale' , async ( ) => {
@@ -3748,8 +3749,9 @@ describe('Localization', () => {
37483749 id : draft . id ,
37493750 collection : allFieldsLocalizedSlug ,
37503751 locale : 'all' ,
3751- draft : false ,
3752+ draft : true ,
37523753 } )
3754+
37533755 expect ( updatedMainDoc . _localizedMeta . en . status ) . toEqual ( 'draft' )
37543756 expect ( updatedMainDoc . _localizedMeta . es . status ) . toEqual ( 'published' )
37553757 } )
@@ -3771,7 +3773,8 @@ describe('Localization', () => {
37713773 id : draft . id ,
37723774 collection : allFieldsLocalizedSlug ,
37733775 data : {
3774- _status : 'draft' ,
3776+ text : 'Published' ,
3777+ _status : 'published' ,
37753778 } ,
37763779 locale : 'en' ,
37773780 publishSpecificLocale : 'en' ,
@@ -3795,11 +3798,10 @@ describe('Localization', () => {
37953798 equals : 'draft' ,
37963799 } ,
37973800 } ,
3801+ draft : true ,
37983802 locale : 'es' ,
37993803 } )
3800- expect ( draftStatusQuery . docs ) . toHaveLength (
3801- ( payload . config . localization as LocalizationConfig ) . locales . length - 1 ,
3802- )
3804+ expect ( draftStatusQuery . docs ) . toHaveLength ( 1 )
38033805 } )
38043806 } )
38053807 } )
0 commit comments