chore(ui): strictly types fields (#5344)

This commit is contained in:
Jacob Fletcher
2024-03-15 17:41:48 -04:00
committed by GitHub
parent 09f2926bbb
commit fb4651bdad
78 changed files with 933 additions and 554 deletions

View File

@@ -14,10 +14,10 @@ export const PostsCollection: CollectionConfig = {
name: 'text',
type: 'text',
},
{
name: 'richText',
type: 'richText',
},
// {
// name: 'richText',
// type: 'richText',
// },
{
name: 'relationship',
type: 'relationship',

View File

@@ -304,7 +304,7 @@ describe('versions', () => {
await expect(
page.locator('.autosave:has-text("Last saved less than a minute ago")'),
).toBeVisible()
expect(await titleField.inputValue()).toBe('global title')
await expect(titleField).toHaveValue('global title')
// refresh the page and ensure value autosaved
await page.goto(url.global(autoSaveGlobalSlug))
@@ -339,7 +339,7 @@ describe('versions', () => {
// change locale back to en
await changeLocale(page, en)
// verify en loads its own title
expect(await titleField.inputValue()).toEqual(title)
await expect(titleField).toHaveValue(title)
// change non-localized description field
await descriptionField.fill(newDescription)
await wait(500)
@@ -352,8 +352,8 @@ describe('versions', () => {
// title should not be english title
// description should be new description
await page.reload()
expect(await titleField.inputValue()).toEqual(spanishTitle)
expect(await descriptionField.inputValue()).toEqual(newDescription)
await expect(titleField).toHaveValue(spanishTitle)
await expect(descriptionField).toHaveValue(newDescription)
})
test('should restore localized docs correctly', async () => {