chore: remove log and fix tests

This commit is contained in:
Jessica Chowdhury
2025-08-13 12:41:34 +01:00
parent 75f9d99895
commit 1b71d69fbd
4 changed files with 9 additions and 4 deletions

View File

@@ -93,7 +93,7 @@ export const replaceWithDraftIfAvailable = async <T extends TypeWithID>({
}
let draft = versionDocs[0]
console.log('replaceWithDraftIfAvailable', versionDocs[0])
if (!draft) {
return doc
}

View File

@@ -198,7 +198,7 @@ export const Status: React.FC = () => {
/>
</React.Fragment>
)}
{!isTrashed && canUpdate && statusToRender === 'changed' && (
{!isTrashed && canUpdate && statusToRender === 'changed' || statusToRender === 'draft' && (
<React.Fragment>
&nbsp;&mdash;&nbsp;
<Button

View File

@@ -685,6 +685,11 @@ describe('Localization', () => {
await saveDocAndAssert(page, '#action-save-draft')
await page.goto(urlPostsWithDrafts.list)
const columns = page.getByRole('button', { name: 'Columns' })
await columns.click()
await page.locator('#_status').click()
await expect(page.locator('.row-1 .cell-title')).toContainText(spanTitle)
await expect(page.locator('.row-1 .cell-_status')).toContainText('Draft')

View File

@@ -1019,7 +1019,7 @@ describe('Versions', () => {
await textField.fill('spanish draft')
await saveDocAndAssert(page, '#action-save-draft')
await expect(status).toContainText('Changed')
await expect(status).toContainText('Draft')
await changeLocale(page, 'en')
await textField.fill('english published')
@@ -1052,7 +1052,7 @@ describe('Versions', () => {
const publishedDoc = data.docs[0]
expect(publishedDoc.text).toStrictEqual({
expect(publishedDoc?.text).toStrictEqual({
en: 'english published',
es: 'spanish published',
})