MCPcopy
hub / github.com/vercel/next.js / refreshAfterServerAction

Function refreshAfterServerAction

test/e2e/app-dir/use-cache/use-cache.test.ts:926–935  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

924 }
925
926 const refreshAfterServerAction = async () => {
927 if (disableJavaScript) {
928 // browser.refresh() seems to automatically resubmit POST requests,
929 // so if we submitted an MPA action, it'll trigger the action again,
930 // which in this case will toggle draftMode again.
931 await browser.get(new URL(pathname, next.url).href)
932 } else {
933 await browser.refresh()
934 }
935 }
936
937 expect(await browser.elementByCss('button#toggle').text()).toBe(
938 'Enable Draft Mode'

Callers 1

use-cache.test.tsFile · 0.85

Calls 2

getMethod · 0.65
refreshMethod · 0.65

Tested by

no test coverage detected