silverwolf-x/project / test /e2e /app-dir /cache-components /cache-components.server-action.test.ts
silverwolf-x's picture
download
raw
1.55 kB
import { nextTestSetup } from 'e2e-utils'
import { waitForNoRedbox, retry } from 'next-test-utils'
describe('cache-components', () => {
const { next, isNextDev } = nextTestSetup({
files: __dirname,
})
it('should not fail decoding server action arguments', async () => {
const browser = await next.browser('/server-action')
expect(await browser.elementByCss('p').text()).toBe('initial')
await browser.elementByCss('button').click()
await retry(async () => {
expect(await browser.elementByCss('p').text()).toBe('result')
})
})
it('should not have cache components errors when encoding bound args for inline server actions', async () => {
const browser = await next.browser('/server-action-inline')
expect(await browser.elementByCss('p').text()).toBe('initial')
if (isNextDev) {
await waitForNoRedbox(browser)
}
await browser.elementByCss('button').click()
await retry(async () => {
expect(await browser.elementByCss('p').text()).toBe(
'result and more and even more'
)
})
expect(next.cliOutput).not.toInclude('Error: Route "/server-action-inline"')
})
it('should prerender pages with inline server actions', async () => {
let $ = await next.render$('/server-action-inline', {})
if (isNextDev) {
expect($('#layout').text()).toBe('at runtime')
expect($('#page').text()).toBe('at runtime')
} else {
expect($('#layout').text()).toBe('at buildtime')
expect($('#page').text()).toBe('at buildtime')
}
})
})

Xet Storage Details

Size:
1.55 kB
·
Xet hash:
77ffaae514c90112c85f1970d2e8c9b65594c98075222c2c6befc4a1bf412f3b

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.