Skip to content

Commit 42324f3

Browse files
committed
chore: test tweaks
1 parent d42f14a commit 42324f3

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

test/localization/int.spec.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3657,6 +3657,7 @@ describe('Localization', () => {
36573657
id: draft.id,
36583658
collection: allFieldsLocalizedSlug,
36593659
data: {
3660+
text: 'Published english',
36603661
_status: 'published',
36613662
},
36623663
locale: 'en',
@@ -3670,7 +3671,6 @@ describe('Localization', () => {
36703671
draft: true,
36713672
})
36723673

3673-
console.log(updatedMainDoc)
36743674
expect(updatedMainDoc._localizedMeta.en.status).toEqual('published')
36753675
expect(updatedMainDoc._localizedMeta.es.status).toEqual('draft')
36763676

@@ -3692,6 +3692,7 @@ describe('Localization', () => {
36923692
},
36933693
locale: 'en',
36943694
})
3695+
36953696
expect(publishedStatusQuery.docs).toHaveLength(1)
36963697

36973698
const draftStatusQuery = await payload.find({
@@ -3702,10 +3703,10 @@ describe('Localization', () => {
37023703
},
37033704
},
37043705
locale: 'es',
3706+
draft: true,
37053707
})
3706-
expect(draftStatusQuery.docs).toHaveLength(
3707-
(payload.config.localization as LocalizationConfig).locales.length - 1,
3708-
)
3708+
3709+
expect(draftStatusQuery.docs).toHaveLength(1)
37093710
})
37103711
})
37113712

@@ -3747,7 +3748,7 @@ describe('Localization', () => {
37473748
draft: false,
37483749
})
37493750
expect(updatedMainDoc._localizedMeta.en.status).toEqual('draft')
3750-
expect(updatedMainDoc._localizedMeta.es.status).toEqual('draft')
3751+
expect(updatedMainDoc._localizedMeta.es.status).toEqual('published')
37513752
})
37523753

37533754
it('should unpublish specific locale', async () => {
@@ -3785,8 +3786,9 @@ describe('Localization', () => {
37853786
id: draft.id,
37863787
collection: allFieldsLocalizedSlug,
37873788
locale: 'all',
3788-
draft: false,
3789+
draft: true,
37893790
})
3791+
37903792
expect(updatedMainDoc._localizedMeta.en.status).toEqual('draft')
37913793
expect(updatedMainDoc._localizedMeta.es.status).toEqual('published')
37923794
})
@@ -3808,7 +3810,8 @@ describe('Localization', () => {
38083810
id: draft.id,
38093811
collection: allFieldsLocalizedSlug,
38103812
data: {
3811-
_status: 'draft',
3813+
text: 'Published',
3814+
_status: 'published',
38123815
},
38133816
locale: 'en',
38143817
publishSpecificLocale: 'en',
@@ -3832,11 +3835,10 @@ describe('Localization', () => {
38323835
equals: 'draft',
38333836
},
38343837
},
3838+
draft: true,
38353839
locale: 'es',
38363840
})
3837-
expect(draftStatusQuery.docs).toHaveLength(
3838-
(payload.config.localization as LocalizationConfig).locales.length - 1,
3839-
)
3841+
expect(draftStatusQuery.docs).toHaveLength(1)
38403842
})
38413843
})
38423844
})

0 commit comments

Comments
 (0)