fix(next): autosave document rendering (#9364)

Closes #9242 and #9365. Autosave-enabled documents rendered within a
drawer were not being properly handled. This was causing multiple draft
documents to be created upon opening the drawer, as well as an empty
document returned from the server function, etc.
This commit is contained in:
Jacob Fletcher
2024-11-19 19:01:54 -05:00
committed by GitHub
parent 4030e212f5
commit 9e85be0006
7 changed files with 82 additions and 36 deletions

View File

@@ -179,10 +179,9 @@ describe('fields - relationship', () => {
await expect(options).toHaveCount(2) // two docs
await options.nth(0).click()
await expect(field).toContainText(relationOneDoc.id)
await saveDocAndAssert(page)
await wait(200)
await trackNetworkRequests(page, `/api/${relationOneSlug}`, {
beforePoll: async () => await page.reload(),
await trackNetworkRequests(page, `/api/${relationOneSlug}`, async () => {
await saveDocAndAssert(page)
await wait(200)
})
})