chore: remove log and fix tests
This commit is contained in:
@@ -93,7 +93,7 @@ export const replaceWithDraftIfAvailable = async <T extends TypeWithID>({
|
||||
}
|
||||
|
||||
let draft = versionDocs[0]
|
||||
console.log('replaceWithDraftIfAvailable', versionDocs[0])
|
||||
|
||||
if (!draft) {
|
||||
return doc
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ export const Status: React.FC = () => {
|
||||
/>
|
||||
</React.Fragment>
|
||||
)}
|
||||
{!isTrashed && canUpdate && statusToRender === 'changed' && (
|
||||
{!isTrashed && canUpdate && statusToRender === 'changed' || statusToRender === 'draft' && (
|
||||
<React.Fragment>
|
||||
—
|
||||
<Button
|
||||
|
||||
@@ -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')
|
||||
|
||||
|
||||
@@ -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',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user